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:merge-into-master [2009/04/16 13:27] andrei |
git:merge-into-master [2012/01/09 01:22] 109.230.216.225 EKKjsDlJvj |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== GIT merge into master howto ===== | + | Your's is the itnleliegnt approach |
- | + | ||
- | * if you don't have a local **master** branch tracking **origin/ | + | |
- | < | + | |
- | git checkout --track -b master origin/ | + | |
- | </ | + | |
- | + | ||
- | * if you already have a local **master** branch tracking **origin/ | + | |
- | + | ||
- | < | + | |
- | git checkout master | + | |
- | # make sure master is up-to-date | + | |
- | git pull --ff origin master | + | |
- | git merge --log --no-ff origin/ | + | |
- | 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: | + | |
- | </ | + | |
- | + | ||
- | * 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' | + | |
- | < | + | |
- | git reset --hard ORIG_HEAD | + | |
- | </ | + | |
- | + | ||
- | * don't try to merge the reverse way, e.g.: git checkout my_branch; git merge master; git push origin my_branch: | + |