summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2015-10-29 11:26:23 +0100
committergebele <gebele@in-silico.ch>2015-10-29 11:26:23 +0100
commitcf5dfce27df2a44434891e9d7252cd8e03132ff6 (patch)
tree42e03750b462fae04b44292c1380ee2a3c7a1220
parentf3bff761f981134e757e90400a2ad4496d90e839 (diff)
additional tips for merging single files with git
-rw-r--r--_posts/2012-06-29-useful-git-tricks.md4
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.