Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.4k points)

I have made several commits on different files, but so far I would like to push to my remote repository only a specific commit.

Is this possible?

1 Answer

0 votes
by (27.5k points)

In order to push up through a given commit run the following command:

$ git push <remotename> <commit SHA>:<remotebranchname>

provided <remotebranchname> already exists on the remote. If it doesn't, you can use git push <remotename> <commit SHA>:refs/heads/<remotebranchname> to autocreate it.

In case you want to push a commit without pushing previous commits, you should first use git rebase -i to re-order the commits.

Browse Categories

...