Reputation: 579
I'm a novice on git/github and I suspect I might have made a mistake with a branch without realising it until now. A few months ago I managed to get everything up and running with git and everything still seems to work fine.
Now, for the first time I want to create a branche and when reading the docs, I noticed that my config might already have a branche that I never intended to create. I think that I only need a master branche right now and then for the new feature I want to test I will create a branche.
Could someone tell me if I'm currently working correctly with just a Master or do I also have a branche without knowing it?
When I run: git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
When I run: git branch -r
origin/master
origin/—set-upstream-to=origin/master
When I run: git remote -v
origin [email protected]:TheGabeMan/NestReporter.git (fetch)
origin [email protected]:TheGabeMan/NestReporter.git (push)
When I run: git branch
* master
—set-upstream-to=origin/master
So I'm wondering if "--set-upstream-to master origin/master" is an incorrect parameter I used which accidentaly converted to a name or is it the correct naming for the remote master?
Upvotes: 0
Views: 52
Reputation: 579
SOLVED: Tried a few more deletes and eventually solved it by running git fetch -p.
When I now run git branch -a
, the result is:
* master
remotes/origin/master
Looks good to me now :-)
Upvotes: 0
Reputation: 1069
Yes it looks like you have inadvertently create both a local and remote branch named "—set-upstream-to=origin/master".
To delete that branch locally, you should be able to run git branch -d "—set-upstream-to=origin/master"
To delete the remote branch, as long as you are using a relatively recent version of git, the most straightforward thing to do is git push origin --delete "—set-upstream-to=origin/master"
.
Upvotes: 2