简体   繁体   中英

How to git merge a file at given commit to current checkout?

Here is the difference of testfile.txt between commit 319e2d8 and 24bf013(current checkout) . The (TO-BE-DELETED) is expected to be deleted, however it's still in the current checkout 24bf013 . How to git merge testfile.txt from 319e2d8 to local 24bf013 ?

$ git diff 319e2d8:testfile.txt 24bf013:testfile.txt
diff --git a/319e2d8:testfile.txt b/24bf013:testfile.txt/appointments.html
index 66f029ed..86601816 100755
--- a/testfile.txt
+++ b/testfile.txt
@@ -55,7 +55,7 @@
 data line 1
 data line 2
 data line 3
-<h1>data line 4</h1>
+<h1>data line 4(TO-BE-DELETED)</h1>
 data line 5
 data line 6

它可以将319e2d8合并到本地,并且仅提交testfile.txt。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM