git - Cloned from a colleague's computer, now pull from Bitbucket still downloads a lot -
we have git repository quite large , behind slow internet connection.
my colleague had recent copy of repository, did
git clone him:/home/foo/repo
in lan - fast :)
after that, made changes, did git pull
. during that, had conflicts merged.
next, made
git remote rename origin him git remote add <bitbucketurl>
i made changes , tried to
git push origin master
which rejected (no fast forward).
so tried
git pull origin
but now, git wants download megabytes of data, not understand. thinking git smart enough cross match objects has. right? additionally, tried cloning , adding bitbucket url without merging; same problem.
what should fix this?
edit address questions in comments:
- there no other branches aware of,
git pull origin master
has same effect - doing git
pull origin master
print:remote: counting objects: 1535
- there no chance many chances done in meantime. - i did compare log, there no changes online (bitbucket) not on colleague's computer cloned from
this not direct answer, is's big comment. tried reproduce situation , works expected me (no download bitbucket on pull).
some possible reasons of why don't work you:
1) check colleague repository - have proper remotes
setup? not sure, git uses remotes metadata understand relations between repositories (just guess)
2) maybe colleague's repository not up-to-date bitbucket? when pull, downloads new data. try update colleague's repository first.
here shell script used check problem, can play around find out causes behavior see:
# change repository url bitbucket_url=git@bitbucket.org:user/project git clone $bitbucket_url project # cloning 'project'... # warning: permanently added rsa host key ip address 'xxx.xxx.xxx.xxx' list of known hosts. # remote: counting objects: 163, done. # remote: compressing objects: 100% (154/154), done. # remote: total 163 (delta 53), reused 0 (delta 0) # receiving objects: 100% (163/163), 3.62 mib | 1.30 mib/s, done. # resolving deltas: 100% (53/53), done. # checking connectivity... done. mkdir mycopy cd mycopy git clone ../project . # cloning '.'... # done. ls # application.py database.py readme.md requirements.txt static git remote -v show # origin /home/seb/test/gitdist/mycopy/../project (fetch) # origin /home/seb/test/gitdist/mycopy/../project (push) git remote rename origin local git remote add origin $bitbucket_url git remote -v show # local /home/seb/test/gitdist/mycopy/../project (fetch) # local /home/seb/test/gitdist/mycopy/../project (push) # origin git@bitbucket.org:owner/project.git (fetch) # origin git@bitbucket.org:owner/project.git (push) git pull origin # warning: permanently added rsa host key ip address 'xxx.xxx.xxx.xxx' list of known hosts. # bitbucket.org:owner/project # * [new branch] master -> origin/master # asked pull remote 'origin', did not specify # branch. because not default configured remote # current branch, must specify branch on command line.
output each command included above, can see there initial repository download project
folder (this emulates colleague's repository) , there no download in local repository when rename origin, add new origin bitbucket url , go git pull origin
.
update: checking 2 git versions
as mentioned in comments other answer, there 2 versions of git involved - git 1.9.4 on colleagues machine , git 2.1.4 locally. have 2.1.4 locally, additionally 1.9.4 version way:
git clone git://git.kernel.org/pub/scm/git/git.git git checkout v1.9.4 make configure ./configure --prefix=/usr make ./git --version # git version 1.9.4
now modified test script way:
# change repository url bitbucket_url=git@bitbucket.org:bosonz/gameofdata.git git194=./git/git $git194 --version $git194 clone $bitbucket_url project # cloning 'project'... # .... # (the rest unchanged)
result - there still no problem, download bitbucket still done once.
Comments
Post a Comment