Take the 2-minute tour ×

Is it possible to clone a project into a new branch ? I have already cloned the main repo and would like to clone another repo that is a fork of it into a branch. I want to be able to keep comparing the differences using git diff. How can this be done ?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

You can specify a new remote and then call git fetch:

git remote add fork git://example.com/repo.git
git fetch fork

You can then compare branches with

git diff origin/master fork/master
share|improve this answer
add comment

Your Answer


