File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 99
99
* [ Remove entry in the global config.] ( https://github.com/git-tips/tips#remove-entry-in-the-global-config )
100
100
* [ Checkout a new branch without any history] ( https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history )
101
101
* [ File diff between staging and the last file version.] ( https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version )
102
+ * [ Extract file from another branch.] ( https://github.com/git-tips/tips#extract-file-from-another-branch )
102
103
103
104
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
104
105
<!-- @doxie.inject end toc -->
@@ -677,5 +678,10 @@ git checkout --orphan <branch_name>
677
678
git diff --staged
678
679
```
679
680
681
+ ## Extract file from another branch.
682
+ ``` sh
683
+ git show < banch_name> :< file_name>
684
+ ```
685
+
680
686
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
681
687
<!-- @doxie.inject end -->
Original file line number Diff line number Diff line change 302
302
},{
303
303
"title" : " File diff between staging and the last file version." ,
304
304
"tip" : " git diff --staged"
305
+ },{
306
+ "title" : " Extract file from another branch." ,
307
+ "tip" : " git show <banch_name>:<file_name>"
305
308
}]
You can’t perform that action at this time.
0 commit comments