0

So I'm just now creating a repo for an old project. In total I have 4.5 gigs of files so it's taking some time. I'm on a shared hosting environment and my host limits processes that take up too much memory for too long a time. Obviously, this process is taking a while, and it keeps getting ended by my host.

Is there a way I can easily chuck up the push for a single commit so I don't get rate limited?

This is also my first commit so I'm having trouble reverting all the files I added. Otherwise I would do it piece by piece.

Steve Robbins
  • 12,813
  • 9
  • 68
  • 117

3 Answers3

2

My first thought is to create the bare repo locally and simply FTP it to the server. That should work ok.

ScottS
  • 8,195
  • 3
  • 26
  • 48
2

In the same idea than ScottS's answer, I would create locally a bundle, in order to create one (giant) file.

FTP a single file is less error-prone than multiple files of a bare git repo.
(See "How to synchronize two git repositories" for a concrete example)

You can then clone from that bundle on the remote side.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
0

If you don't have all your work in a single commit, you can git push your commits partially.

Using git log you can "walk" you history, checking some commits and pushing them to your remote. Lets say:

$ git log --oneline master
$ git checkout abcabc123123 # 10th commit in history
$ git push origin HEAD:master
$ git checkout bcdef145325 # 30th commit in history
$ git push origin HEAD:master

And so on...

How many commits your step will have to be will be a try&failure task - it depends on your commits' size.

If you don't have any history, maybe you can make individual commits for each file/folder (I think it would be a good idea to associate by filesize), push them as before told, and then squash all commits in a single one:

$ git checkout master
$ git reset acbacbad142 # hash of first commit
$ git commit --ammend
$ git push -f origin master

You rebase all your changes in a single commit with the reset + commit --ammend, and then push -f to rewrite the remote branch. Files (blobs, in git terms) will already be uploaded (even the tree will be), so it should not take big time. As you are re-writing history, be sure no one clones/fetches from the remote in the time between you start making your short pushes and the time you push the squashed commit, to avoid conflicts.

mgarciaisaia
  • 12,099
  • 8
  • 48
  • 73