Ryan
Ryan

Reputation: 21

How do I switch between projects on Git command line?

I have two different projects on my GitHub account: my own and a forked repository I am contributing to. My forked copy is not up to date with the most recent change made on the master copy on the project head's account. I want to update my forked project to reflect the most recent changes, but I think my Terminal is telling me I am located in my own project. How do I switch to the forked repository in Terminal and update changes?

Upvotes: 2

Views: 7620

Answers (1)

Siguza
Siguza

Reputation: 23850

GitHub has a help pages for syncing a fork.

It basically says:

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git # Only the first time
git fetch upstream
git checkout master
git merge upstream/master

Upvotes: 1

Related Questions