File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,39 @@ <h1>GIT commands that I can't remember</h1>
16
16
</ p >
17
17
18
18
< p >
19
- 2. Add remote
19
+ 2. Add remote:
20
20
< br />
21
21
< br />
22
22
< i style ="margin-left: 20px "> > git remote add origin ssh://...</ i >
23
23
</ p >
24
24
25
25
< p >
26
- 3. Revert file to a version from commit
26
+ 3. Revert file to a version from commit:
27
27
< br />
28
28
< br />
29
29
< i style ="margin-left: 20px "> > git checkout abcd-hash -- file/to/restore </ i >
30
30
</ p >
31
31
32
+ < p >
33
+ 4. Make a patch:
34
+ < br />
35
+ < br />
36
+ < i style ="margin-left: 20px "> > git format-patch -1 HASH </ i >
37
+ < div style ="margin-left: 20px ">
38
+ The -1 flag tells Git how many commits should be included in the patch.
39
+ < br />
40
+ < br />
41
+ Apply:
42
+ < br />
43
+ < br />
44
+ < i > > git am < file .patch </ i >
45
+ </ div >
46
+ </ p >
47
+
48
+ < p >
49
+ Credits: < a href ="https://stackoverflow.com/a/6658352/1361132 "> https://stackoverflow.com/a/6658352/1361132</ a >
50
+ </ p >
51
+
32
52
< h5 style ="color:grey; ">
33
53
1 November 2021
34
54
</ h5 >
You can’t perform that action at this time.
0 commit comments