Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
git:tips [2009/02/15 22:49]
78.102.130.97 created
git:tips [2009/07/21 14:35] (current)
andrei --rebase to git pull, in case there are local changes on the local master
Line 10: Line 10:
 </code> </code>
 See ''man git-pack-refs'' for more details. See ''man git-pack-refs'' for more details.
 +
 +====== Avoiding Tag Collisions ======
 +If you fetch tags from multiple remote repositories, it may happen that they will generate conflicts because all tags are stored in .git/refs/tags directory. This will happen, for example, if you fetch objects from both the sip-router git repository and also the repository at http://git.sip-router.org/ser. The reason is that both of them originate from a single cvs repository and thus they contain tags with identical names.  To avoid this situation you can do the following in your .git/config:
 +
 +<code>
 +[remote "sr"]
 +    ....
 +    fetch = refs/tags/*:refs/tags/sr/*
 +    tagopt = --no-tags
 +
 +[remote "cvs"]
 +    ....
 +    fetch = refs/tags/*:refs/tags/cvs/*
 +    tagopt = --no-tags
 +</code>
 +
 +The configuration above will fetch all tags from both repositories explicitly and will store them in subdirectories under .git/refs/tags to avoid conflicts in file names. Because you download tags explicitly you can tell git-fetch not to download any tags using the tagopt option.
 +
 +====== GIT commands for merging of modules  ======
 +This will show you how the git commands to merge modules, e.g. ser's avpops module is removed and K's avpops module is used as comon module.
 +<code>
 +# we start in the local master branch
 +git checkout master
 +
 +# create a new local branch called "darilion/avpops" based on 
 +# the remote master branch, and checkout into the newly created branch
 +git checkout -b darilion/avpops origin/master
 +
 +# remove the old ser module
 +git rm -r modules_s/avpops/
 +
 +# move the Kamailio module into the common modules directory
 +git mv modules_k/avpops/ modules/
 +
 +# do whatever is need, eg. modify the code, ...
 +
 +# check if sip-router builds and the code is working as expected
 +
 +# check the status (modified files)
 +git status
 +
 +# add all modifications for the next commit
 +git add .
 +
 +# commit the changes (which were added in the previous step)
 +# (this will commit into the local working branch, in this case darilion/avpops)
 +# make sure to add a commit message according to these rules:
 +#   http://sip-router.org/wiki/devel/git-commit-guidelines
 +git commit
 +
 +# verify the commit
 +git log -1
 +
 +# prepare for push into the remote master branch: make sure
 +# that our local branch is up2date with commits added to 
 +# remote main branch
 +git fetch origin
 +git rebase origin/master
 +
 +# push our changes from the local "darilion/avpops" branch 
 +# into the remote master branch
 +git push origin darilion/avpops:master
 +
 +# cleanup: change into another local branch and delete the local avpops branch
 +git checkout master
 +git pull --rebase origin master # fetch previously commited commit
 +git branch -d darilion/avpops
 +</code>
 +

Navigation

Wiki

Other

QR Code
QR Code git:tips (generated for current page)