Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep the GIT repos in sync

Tags:

git

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

fatal: Not a git repository (or any of the parent directories): .git

Thanks, mE

like image 329
amok Avatar asked Feb 12 '11 02:02

amok


1 Answers

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.

like image 81
markdorison Avatar answered Oct 02 '22 12:10

markdorison