What's the fastest way to work in git over a slow network connection?
Doing a little test here, i was able to do the following...
We have a shared --bare repo out on the network
i have the remote setup as git remote add origin <pathToSharedRepo>
i do a git pull origin <branch> --depth=1
(not at git fetch
but git pull
)
this successfully pulls only the "HEAD + depth" commits for this branch. I can do commits to this and the such and then push (git push
should work just fine) it back out without issue.
to pull the new commits and JUST the new commits from the shared repo, i have to explicitly type git pull origin <branch>
. Since this is the way I originally did the pull (explicitly), I have to do the same this time...
This should not pull down any more history than the depth you originally set (it doesnt care)
To be complete, you can also do a depth setting when you're cloning the repo:
git clone -b <branch> <pathToRepo> --depth=<numCommitsWanted>