Push a Specific Git Commit to Remote

Arunvel SriramArunvel Sriram
1 min read

TIL that its possible to push a specific Git Commit to Remote.

git push origin <commit-sha>:<branch>

Though, if there are any un-pushed commits before <commit-sha>, then those will be pushed. So if we want to push <commit-sha> alone then we need to reorder and make it the first un-pushed local commit and then target it using above command.

0
Subscribe to my newsletter

Read articles from Arunvel Sriram directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Arunvel Sriram
Arunvel Sriram

Software Engineer | Polyglot | DevOps | Open Source