I have a super slow connection right now, and I need to push a new branch into my company's git server. With SVN, I am able to commit/push files to a remote SVN server one at a time if I'd like. In the past, when I had a slow connection, I was able to upload a folder at a time and it worked great. I sure could use something similar in git.
Is it possible to push a git repository in sections?
374 Views Asked by Byron Sommardahl At
2
There are 2 best solutions below
0

If your branch consists of many small commits adding up to one large change, you might be able to effect this by pushing the commits up in stages. Perhaps create a new branch starting at the point at which your code diverges from that on the company server, then pull ranges of commits from your branch in stages and push after each range is pulled.
But pushing separate folders/files - I'm pretty certain that's not possible: it rather goes against git's requirement that a commit be an atomic entity.
When you do a git-push(1), the manual says:
As a result, you should be able to push individual commits up to the remote by organizing them in chronological order, and then specifying each one in a detailed refspec. For example:
I tested this locally, and it seems to work as intended. Give it a try; if nothing else, it will get you pointed in the right direction.