Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
git:quick-start-guide [2008/11/27 14:21] andrei |
git:quick-start-guide [2009/04/23 11:30] andrei added note about autosetuprebase |
||
---|---|---|---|
Line 6: | Line 6: | ||
===== GIT URLs ===== | ===== GIT URLs ===== | ||
- | * git:// | + | * %%git:// |
- | * http:// | + | * http:// |
- | * ssh:// | + | * %%ssh:// |
Line 14: | Line 14: | ||
* http:// | * http:// | ||
- | |||
- | |||
===== First config options ===== | ===== First config options ===== | ||
Line 21: | Line 19: | ||
* First of all, set your name and email address: | * First of all, set your name and email address: | ||
< | < | ||
- | git config --global user.name | + | git config --global user.name ' |
- | git config --global user.email | + | git config --global user.email 'your email address' |
</ | </ | ||
- | | + | Some other recommended git config setting: |
- | * include summaries of merged commits in commit merge messages (a MUST) | + | |
+ | * include summaries of merged commits in commit merge messages (a **MUST**) | ||
< | < | ||
git config --global merge.log true | git config --global merge.log true | ||
Line 35: | Line 34: | ||
git config --global branch.autosetupmerge always | git config --global branch.autosetupmerge always | ||
</ | </ | ||
- | + | * by default perform a rebase instead of a merge when pulling | |
- | + | ||
- | ===== GIT merge into master | + | |
- | + | ||
- | * if you don\'t have a local **master** branch tracking | + | |
< | < | ||
- | git checkout --track -b master origin/master | + | git config branch.master.rebase true |
</ | </ | ||
- | + | * by default setup all new local branches to perform rebase (like above) when pull-ing (so that you don' | |
- | | + | |
< | < | ||
- | git checkout master | + | git config branch.autosetuprebase always |
- | git merge --log origin/ | + | </ |
- | git log -1 # make sure you see a correct merge message | + | * (**not recommended**) by default use --no-ff when merging into master (this means that a merge commit message will be generated for all merges; without it fast-forward merges will not generate a merge message). **Note**: |
- | gitk # optional, look if the commit tree looks ok | + | < |
- | # only if everything is ok and you looked at the log | + | # _not_ recommended, use _only_ |
- | git push origin master:master | + | # branches (see Note: above), otherwise |
+ | # git config branch.master.mergeoptions | ||
</ | </ | ||
- | * 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 | + | ===== GIT commit into master |
- | * 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\' | + | Please |
- | < | + | |
- | git reset --hard ORIG_HEAD | + | ===== GIT merge into master howto ===== |
- | </ | + | |
- | * 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. | + | Please see [[git:merge-into-master|GIT merge into master |