In my git repository local branch, it is behind by 9 commits. Can you please tell me how can I advance it by 1 commit?
# Your branch is behind 'my-git/remote' by 9 commits, and can be fast-forwarded.
I have read How can I fast-forward a single git commit, programmatically? I don't understand the answer.
I don't need to do it programmically. Is there a command line way I can use?
In this specific instance you could do
git merge my-git/remote~8 --ff-only
Explanation: you are saying you want all commits from the branch 'my-git/remote' merged into your current branch, except for the 8 latest commits. The except part is covered in the "~8". "--ff-only" is there for safety, but not strictly neccessary.
Advance (or fast-forward) is the same as merge in case if history is not diverged. So, you could merge to a commit you need, e.g.
git merge my-git/remote~8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With