Saturday, 15 May 2010

git fetch - Retrieve specific commit from a remote Git repository -



git fetch - Retrieve specific commit from a remote Git repository -

is there way retrieve 1 specific commit remote git repo without cloning on pc? construction of remote repo absolutely same of mine , hence there won't conflicts have no thought how , don't want clone huge repository.

i new git, there way?

you clone once, if have clone of remote repository, pulling won't download again. indicate branch want pull, or fetch changes , checkout commit want.

fetching new repository very inexpensive in bandwidth, download changes don't have. think in terms of git making right thing, minimum load.

git stores in .git folder. commit can't fetched , stored in isolation, needs ancestors. interrelated.

to cut down download size can inquire git fetch objects related specific branch or commit:

git fetch origin refs/heads/branch:refs/remotes/origin/branch

this download commits contained in remote branch branch (and ones miss), , store in origin/branch. can merge or checkout.

you can specify sha1 commit:

git fetch origin 96de5297df870:refs/remotes/origin/foo-commit

this download commit of specified sha-1 96de5297df870 (and ancestors miss), , store (non-existing) remote branch origin/foo-commit.

git git-fetch

No comments:

Post a Comment