Added points to note for git merge (#25278)

* Added points to note for git merge

mentioned the drawback of too many merge commits and how rebase can be used instead

* Added pitfalls of Rebase Command

Added Pitfalls of Rebase command as well.
This commit is contained in:
Aditya Sridhar
2019-01-08 20:33:17 +05:30
committed by Manish Giri
parent 9de5460b92
commit 696cc38287

View File

@ -52,4 +52,12 @@ In the code editor Git uses markings to indicate the HEAD (master) version of th
From the code editor delete/update to resolve conflict and remove the special markings including the HEAD and OTHER file names, reload your file, then re add and recommit your changes.
## Points to Note
Whenever a merge is done, an extra merge commit is created. Whenever you are working in your local repository, having too many merge commits can make the commit history look confusing. One way to avoid the merge commit is to use git rebase instead. Git rebase is covered in the git-rebase section.
Rebase is a great functionality but it has some issues as well. Rebase basically alters the commit history. So if rebase is used in the remote repository then it can create a lot of confusion. As much as possible, run rebase only on a local repository.
Both git merge and git rebase are very useful commands and one is not better than the other.
For more information about the `git merge` command and all available options, please refer to the <a href="https://git-scm.com/docs/git-merge" target="_blank" rel="nofollow">Git documentation</a>.