I am trying to do a git push to a remote server, for a big project. Is there any way once the upload is started, that if the connection is lost, I can resume the git push command and not have to start all over again?
edit: I am trying to push to github
edit2: so it seems that the way to go is doing it incremental. Can somebody put an example on how to do that when I have the full repository already on my computer?
Thanks
To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the <refspec>... section above for details. Force an update only if the tip of the remote-tracking ref has been integrated locally.
There is currently no way to resume a git clone using git, but there is a neat trick you can use instead of cloning directly -- using git bundle files. Here is how you would do it. Once this is done, you can delete the "clone. bundle" file, unless you think you will need to perform a fresh clone again in the future.
Hacky workaround: push several intermediate commits, so that you're not pushing as much each time. This of course won't save you if it's a single enormous commit that's failing to push.
# develop, and end up wanting to push master
git branch master-tmp <commit>
git push origin master-tmp:master
git branch -f master-tmp <a more recent commit>
git push origin master-tmp:master
# ...keep going until you've pushed everything you want
There are two primary ways to pick the commits to push:
master~15
, master~10
, master~5
(15, 10, and 5 commits before master
)
Use gitk
to manually find them; when you select a commit in the history, the SHA1 is automatically put in the middle-click paste clipboard.
rsync your .git/objects directory to the remote, then do git push - it will go much faster.
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