Added note about checking for merged branches

This should check if your commits are fully merged or not. Mostly taken from
http://stackoverflow.com/questions/7548926/git-and-the-branch-x-is-not-fully-merged-error.
This commit is contained in:
Richard Littauer 2015-05-20 00:31:53 +07:00
parent a4af688a5c
commit 84d543db7d
1 changed files with 16 additions and 0 deletions

View File

@ -52,6 +52,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
- [Delete/remove arbitrary commit](#deleteremove-arbitrary-commit)
- [Delete tag](#delete-tag)
- [Deleted Patch](#deleted-patch)
- [Check if all commits on a branch are merged](#check-if-all-commits-on-a-branch-are-merged)
- [Other Resources](#other-resources)
- [Books](#books)
- [Tutorials](#tutorials)
@ -650,6 +651,21 @@ If someone has sent you a pull request on GitHub, but then deleted their origina
After commiting, change the author of the previous commit. To do this, see how to [change author](#commit-wrong-author). Then, apply whatever changes needed on to, and make a new pull request.
<a name="check-if-all-commits-on-a-branch-are-merged"></a>
## Check if all commits on a branch are merged
To check if all commits on a branch are merged into another branch, you should diff between the heads (or any commits) of those branches:
```sh
(master)$ git log --graph --left-right --cherry-pick --oneline HEAD...feature/120-on-scroll
```
This will tell you if any commits are in one but not the other, and will give you a list of any nonshared between the branches. Another option is to do this:
```sh
(master)$ git log master ^feature/120-on-scroll --no-merges
```
# Other Resources
## Books