On 2017-02-13, at 8:17 PM, adam_sher...@flightcentre.com wrote:
> 
> Another dev has made some changes that I wish to have on my local repo 
> (checkout?) as some future work requires his files. In fact, I thought, I may 
> as well update my local version of the site by grabbing all the updates that 
> have been transferred (pushed?) to the develop repo
> ...
> I then tried `git fetch develop` but this threw an error that said "'develop' 
> does not appear to be a git repository".
> 
> Same as above with `git pull develop`.

TL;DR: fetch/push/pull take a remote repository, not a local branch.

Commands like checkout, merge, etc, all take branch names or sha's, or 
something that identifies a commit. The repository used is always your own 
repository.

The commands push, fetch, and pull take a remote repository, and a set of 
commits. Exactly which commit is being referred to is something I'm not really 
sure of. I'm pretty sure that the commit is deciphered on the remote side, but 
there is a "default translation" so that git will expand your name to the 
corresponding remote side name.

Additionally, that translation can be set up to include a repository. So "git 
fetch mike-develop" might expand into fetching the branch develop from the 
repository owned by mike, and put into a local branch called "mike-develop".

But the local branch "mike-develop", which mirrors the "develop" branch from 
repository "mike", is marked as "not permitting commits". It becomes a "remote 
tracking branch", and won't let you do anything to it other than branching a 
new branch off it.

Internally, the git objects in the repository have no idea if they come from a 
remote branch or the local branch. Since the same file might exist on both 
cases, and the same object will represent the same file, that's kinda required. 
So your local branch off the remote tracking branch will behave like any other 
local branch, and will point to objects in your local object store.

The exact translation is called a "refspec". The default repository is 
"origin". 

In general, "fetch" is safer than "pull", as "pull" forces a merge, while 
"fetch" gives you a chance to make sure you got what you thought you were 
getting (very useful if, like me, you are still learning how to work with 
someone else's repository, instead of only my own public repository).

---
Entertaining minecraft videos
http://YouTube.com/keybounce

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to