This is an old revision of the document!
GIT Quick Start Guide
The document tries to collect useful information to make life easier working with the GIT repository of SIP Router Project.
GIT URLs
- git:git.sip-router.org/sip-router - (read only) * http://git.sip-router.org/sip-router - (read only, slower, git:… recommended)
- ssh:git.sip-router.org/sip-router - (read/write, developer account needed on git.sip-router.org) ===== Web interface ===== * http://git.sip-router.org/cgi-bin/gitweb.cgi ===== First config options ===== * Recommended git version: >= 1.5.6.1 * First of all, set your name and email address: <code> git config –global user.name \'your_name\' git config –global user.email \'your email address\' </code> * Some other recommended git config setting: * include summaries of merged commits in commit merge messages (a MUST) <code> git config –global merge.log true git config –global merge.summary true # same as above, for older git versions </code> * behave as if –track is added to every git-pull <code> git config –global branch.autosetupmerge always </code> ===== GIT merge into master howto ===== * if you don\'t have a local master branch tracking origin/master (git branch|grep master is empty) <code> git checkout –track -b master origin/master </code> * if you already have a local master branch tracking origin/master <code> git checkout master git merge –log origin/branch_to_merge # for older git version, make sure merge.summary is true and skip –log git log -1 # make sure you see a correct merge message (with summary), if not abort gitk # optional, look if the commit tree looks ok # only if everything is ok and you looked at the log git push origin master:master </code> * if you did something wrong and pushed, and it cannot be easily corrected by a git revert, send an email to sr-dev@lists.sip-router.org asking to revert master to the previous state (this should be avoided in general since it would cause extra work for all people who fetched or pulled master in the meantime) * if you need to abort or undo a merge attempt, you don\'t have any local changes that you want to keep and you haven\'t pushed back to origin (if you did, see above), use: <code> git reset –hard ORIG_HEAD # WARNING: all local changes to the current branch will be lost </code> * don\'t try to merge the reverse way, e.g.: git checkout my_branch; git merge master; git push origin my_branch:master. The merge is equivalent to the above one (from the code point of view), but the merge commit message will be wrong.