I am used to pull from a git repository of someone. Today he moved his repository to another address. I wonder if there is some way for me to pull from the new address and to get the info of what changes he made with respect to last time before his moving?
What I have done is "git clone newaddress" under my repository pulled from his old one. The output is like:
got xxx
walk xxx
got xxx
got xxx
walk xxx
Getting alternates list for newaddress
Getting pack list for newaddress
Getting index for pack xxx
Getting pack xxx
which contains xxx
got xxx
got xxx
walk xxx
...
Then I "git pull" and got the following message which I don't understand:
You asked me to pull without telling me which branch you want to merge with, and 'branch.master.merge' in your configuration file does not tell me either. Please name which branch you want to merge on the command line and try again (e.g. 'git pull '). See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to configure the following variables in your configuration file:
branch.master.remote = <nickname> branch.master.merge = <remote-ref> remote.<nickname>.url = <url> remote.<nickname>.fetch = <refspec>
See git-config(1) for details.
What can I do now to still be able to get the info of what changes he made with respect to last time before his moving?
Thanks and regards!
If I'm understanding your question correctly, what you are looking to do is replace your current remote origin with a new one. I don't know if you can replace it from command line, but you can change it in your .git/config
(this is in your project directory)
OLD
[remote "origin"]
url = git+ssh://original_repository.com/my_project.git
...
NEW
[remote "origin"]
url = git+ssh://new_repository.com/my_project.git
...
The git+ssh
part might be something like git@
(this is what it would be if you were using github), or I'm sure a variety of other things. This might help clear up some things that I left out or didn't explain well enough: Changing Your Origin.
Hope this helps answer your question. Cheers.
Run this in your cloned git repository:
git config branch.master.remote origin
to take care of the "You asked me to pull without telling me"... message.
Then, if you know where the remote repo was moved, you could do in your new cloned local repo a git diff
since that date.
$ git diff "@{yesterday}"
$ git whatchanged --since="2 weeks ago"
Note: the upcoming git1.6.5 mentions
Human writable date format to various options, e.g. "
--since=yesterday
", "master@{2000.09.17}
", are taught to infer some omitted input properly.
See also the SO question "How do you get git to always pull from a specific branch?"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With