Katushai
Katushai

Reputation: 1520

Xcode is creating a new branch every time I try to switch to another with Git?

I have a branch named development. For some reason, every time I switch to development and try to merge into another, Xcode is creating a new branch titled development1, development2, development3, etc etc. I am not sure why this is happening or how to stop it.

It left me in an unfortunate situation. We have a billion branches on the project now. Any ideas?

I'm just trying to switch and merge. This is making a mess of the project. I'm not sure how to handle it.

Upvotes: 1

Views: 490

Answers (2)

Katushai
Katushai

Reputation: 1520

I was switching to the remote branches. Every time I did that, it created a new branch locally. This could be considered an Xcode bug, but I have a feeling I was simply misusing Git. I'm just picking it up.

Upvotes: 2

drewag
drewag

Reputation: 94733

Sounds like a potential bug in Xcode. I recommend just using the command line:

  1. To switch to another branch:

    git checkout branch_name

  2. To delete a branch:

    git checkout -d branch_name

  3. To force delete a branch (if commits on a branch are not on any other branch):

    git checkout -D branch_name

  4. To merge with another branch

    git checkout branch_to_change

    git merge branch_to_merge_into_current_branch

Upvotes: 4

Related Questions