Square-root
Square-root

Reputation: 883

Pulling a remote repo that has same branch name as local?

So if I have a local branch called animal and then someone else publishes a remote branch in GitHub that has the same name animal. What happens if I try to:

pull --rebase origin master

Will it overwrite it?

Upvotes: 1

Views: 494

Answers (2)

qzb
qzb

Reputation: 8808

The best idea would be rename your animal branch:

git branch --move animal my_animal

Of course you can also pull remote branch to local one with changed name:

git fetch
git checkout -b other_animal origin/animal

Upvotes: 2

Benja
Benja

Reputation: 4154

no, you'd just be rebasing your local animal from origin master. you will only have trouble when trying to push your animal to the same origin (branch already exists).

Upvotes: 2

Related Questions