File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,17 @@ I tried to organize git commands by situation where you can need them and I adde
16
16
- add them in your current branch
17
17
- [ Doc] ( https://git-scm.com/docs/git-cherry-pick )
18
18
19
+ ### When you only want to push some of your commits in your branch
20
+
21
+ - ` git push ebe6952:main ` where ` ebe6952 ` is the latest commit you want to push
22
+ - push your main branch until the commit ` ebe6952 `
23
+ - it's useful in caseswhen you have ` A -> B -> C -> D -> E ` on your local repository and you only want to push ` C ` and ` D `
24
+ - [ Doc] ( https://git-scm.com/docs/git-push#Documentation/git-push.txt-ltrefspecgt82308203 )
25
+
26
+
19
27
### When you messed up your repository with git commands like rebase and want to recover changes from a commit not in your history anymore
20
28
- ` git reflog `
21
- - gives you an history of the references of your HEAD (current active branch)
29
+ - give you an history of the references of your HEAD (current active branch)
22
30
- allow you to see on which commit was your HEAD after each git command you did
23
31
- once you have the commit hash you are interested in, you can see what changes were made in this commit or even reset the branch to this commit
24
32
- [ Doc] ( https://git-scm.com/docs/git-reflog )
You can’t perform that action at this time.
0 commit comments