diff options
Diffstat (limited to '_posts/2012-06-29-useful-git-tricks.md')
-rw-r--r-- | _posts/2012-06-29-useful-git-tricks.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/_posts/2012-06-29-useful-git-tricks.md b/_posts/2012-06-29-useful-git-tricks.md index b9dfa89..f8b4c04 100644 --- a/_posts/2012-06-29-useful-git-tricks.md +++ b/_posts/2012-06-29-useful-git-tricks.md @@ -60,3 +60,7 @@ Now, origin should also be downgraded on branch `<branch>`. Here is how to remov git push origin :<branch> +## Merge specific files from branch to branch + +Suppose you want merge a specific `FILE` or commit from branch `feature/foo` to any other branch eg. branch `master` you can use `--patch`. +First checkout to your destination branch `git checkout master`. Then `git checkout --patch feature/foo FILE`. It gives you additional prompt to control merge options where you can agree or deny single diffs within the file you want to merge. Same procedure with single commits. |