... | ... | @@ -47,6 +47,41 @@ git add <file-in-question> |
|
|
git commit --amend
|
|
|
```
|
|
|
|
|
|
|
|
|
## Find out what branches have been merged
|
|
|
|
|
|
It can be tricky to find out if you have merged your forks dev-branch or not. This is one way.
|
|
|
|
|
|
|
|
|
Assumes you have set up your local working copy as described in: https://source.coderefinery.org/nordugrid/arc/-/wikis/Contributing/Cheat-Sheet and updated your forks master and next branch with the upstream branches:
|
|
|
|
|
|
``` current_branch=$(git rev-parse --abbrev-ref HEAD); for branch in master next; do git checkout $branch && git pull upstream $branch;git push -u origin $branch; git checkout $current_branch; done;
|
|
|
```
|
|
|
|
|
|
|
|
|
Then:
|
|
|
|
|
|
```git branch <flag[-r/-a/none]> --merged master``` list of all branches merged into master.
|
|
|
|
|
|
Flags Are:
|
|
|
|
|
|
```
|
|
|
-a flag - (all) showing remote and local branches
|
|
|
-r flag - (remote) showing remote branches only
|
|
|
<emptyFlag> - showing local branches only
|
|
|
```
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
Show all branches that you have on your local working directory that were merged into next
|
|
|
|
|
|
``` git branch --merged next```
|
|
|
|
|
|
Show all the remote branches that have been merged into master
|
|
|
|
|
|
``` git branch -r --merged master```
|
|
|
|
|
|
|
|
|
## Useful links
|
|
|
https://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet/
|
|
|
https://gist.github.com/Chaser324/ce0505fbed06b947d962<br>
|
... | ... | |