Difference between revisions of "Git/merge"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Git
Jump to navigation Jump to search
(Created page with "'''Action''': join two or more development histories together "Incorporates changes from the named {{l/same|commit}}s (since the time their histories diverged from the curre...")
 
(more information)
Line 2: Line 2:
  
 
"Incorporates changes from the named {{l/same|commit}}s (since the time their histories diverged from the current {{l/same|branch}}) into the current branch. This command is used by [[../pull|git pull]] to incorporate changes from another repository and can be used by hand to merge changes from one branch into another."
 
"Incorporates changes from the named {{l/same|commit}}s (since the time their histories diverged from the current {{l/same|branch}}) into the current branch. This command is used by [[../pull|git pull]] to incorporate changes from another repository and can be used by hand to merge changes from one branch into another."
 +
 +
Things to remember:
 +
* It's better to have all changes committed before you try a merge.
 +
* If the merge fails, you can "back out" with <code>git merge --abort</code>.
 +
* If things get too ugly and you just want to revert to a known state, <code>git {{l/same|reset}} --hard {{arg|commit}}</code> blows away all uncommitted changes and reverts to the given commit.
 
==Links==
 
==Links==
 
===Documentation===
 
===Documentation===
 
* [https://www.kernel.org/pub/software/scm/git/docs/git-merge.html manpage @ kernel.org]
 
* [https://www.kernel.org/pub/software/scm/git/docs/git-merge.html manpage @ kernel.org]
 +
===How To===
 +
* [http://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging 7.8 Git Tools - Advanced Merging]

Revision as of 01:18, 30 March 2015

Action: join two or more development histories together

"Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch. This command is used by git pull to incorporate changes from another repository and can be used by hand to merge changes from one branch into another."

Things to remember:

  • It's better to have all changes committed before you try a merge.
  • If the merge fails, you can "back out" with git merge --abort.
  • If things get too ugly and you just want to revert to a known state, git reset --hard <commit> blows away all uncommitted changes and reverts to the given commit.

Links

Documentation

How To