Darko
Darko

Reputation: 1768

git push non for all the commits

I have a problem about using git push on my project. I've 7 commits to push, but they are so big for my internet connection that I can't complete the command.

So I'd like to push the oldest commit, than the second, and so on.

What are the commands to see the commit's name and to push them one at time?

Upvotes: 1

Views: 41

Answers (1)

gturri
gturri

Reputation: 14639

Let's say you have an historic like this:

A -- B -- C -- D -- E -- F -- G -- H
|                                  |
origin/master                      master

What you want to do is to push only commit B first, then only C, and so on, and so forth.

To do this, you can use several times the command

git push <remote name> <local commit to push>:<remote branch>

ie: use the the successive commands

git push origin B:master
git push origin C:master
...
git push origin H:master

where B should be replaced by the sha1 of the commit B (or by any other way to point at this commit. For example master~6)

Upvotes: 2

Related Questions