Pergunta

I have a remote repository and 2 local repositories let say repo1 and repo2. I am working on a branch (project1) which is checked out from repo1. There is another branch (project2) which is checked out from repo2. Project2 branch has my changes which I have committed but not pushed (Don't want to push). I want to fetch all changes from project2 to project1 branch. I did

git fetch <my repo2> project2

and then cherry-pick the latest commit. But It only fetch the latest commit changes. I tried to fetch between first and last commit but in this case it only fetch the first commit.

git fetch <my repo2> project2 && git cherry-pick <First commit SHA1>..<last Commit SHA1>

Could anyone please help me to find the problem. How can I fetch a complete branch from repo2 to repo1.

Foi útil?

Solução

If you want to merge then merge:

git fetch <my repo2> project2 && git merge FETCH_HEAD

cherry-pick picks only single commit changes.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top