Take the 2-minute tour ×

I don’t grasp GIT yet. So I have a basic question:

I want to keep one of the repos that I am using (I don’t own it, I cloned it) in sync with my local copy.

How do I do that?

I am aware of git fetch/pull but when I do run that in the same folder where I executed git clone http://.....git I get the following error


Thanks, mE

share|improve this question

3 Answers 3

up vote 0 down vote accepted

Git clone creates a new directory for cloned repo. You need to go into it first. For example:

$ git clone git://github.com/git/hello-world.git
$ cd hello-world
$ git fetch
share|improve this answer

git fetch will retrieve all changes from the remote.

git pull will merge those changes from the remote into your local copy (this accomplishes two commands in one step. fetch & merge

If you have commit access to the remote repository, git push will push your local changes to the origin that you cloned from.

share|improve this answer
when I do that I get an error, like this: fatal: Not a git repository (or any of the parent directories): .git -- and I do run the command in the same path where I did the git clone –  amok Feb 12 '11 at 21:52
@amok Are you in the directory that was cloned? What do you see when you type 'git status'? –  markdorison Feb 12 '11 at 23:22

Git fetch will download all of the changes that exist on the remote, but won't update your working tree. Git pull will download changes and if you're on a local branch tracking a remote branch, will update it for you.

share|improve this answer

Your Answer


