Questions tagged [remote-branch]
133 questions
22
votes
3 answers
How to remove remote origin/refs/heads/master
Don't ask me how but I managed to get accidentally the following remote branches in a git repository:
$ git branch -r
origin/HEAD -> origin/master
origin/master
origin/refs/heads/master
All are pointing to the same commit. How can I remove…
![](../../users/profiles/85514.webp)
Peter Smit
- 24,538
- 27
- 105
- 165
20
votes
5 answers
Error pushing changes on GIT. Ref names must follow git ref-format rules
I have one error using git on Sourcetree.
I've created a local branch called sprints/Mycompany_sprint_1 (because I want it in a category) and then I did multiple cherry picks to this branch from another one.
After that, I tried to push all the…
![](../../users/profiles/6355591.webp)
Inazense
- 1,177
- 2
- 13
- 22
20
votes
2 answers
Why does Git tell me "Not currently on any branch" after I run "git checkout origin/"?
I was trying to follow the instructions from Git: "Not currently on any branch." Is there an easy way to get back on a branch, while keeping the changes? but git checkout appears to be broken:
$ git checkout origin/web-zach
HEAD is now at 1366cb1...…
![](../../users/profiles/2528472.webp)
hubatish
- 4,629
- 4
- 30
- 41
19
votes
2 answers
Push a branch of a git repo to a new remote (github), hiding its history
My organisation is preparing to release an open-source version of our software using github, however I'm not sure the best way to approach this:
We have two branches master and release, master contains some proprietary components that we have…
![](../../users/profiles/150807.webp)
David Claridge
- 5,789
- 2
- 24
- 25
18
votes
5 answers
How to tell which remote svn branch is a local git branch tracking?
I'm a bit confused about how to commit on several svn branches from different local git branches. In particular, even though I've read many of the relates questions on this topic, there's one specific thing that nobody seems to have explained so…
![](../../users/profiles/60531.webp)
UncleZeiv
- 17,080
- 6
- 46
- 74
17
votes
1 answer
Git pull origin overwrites master?
I have a repository on Github, aav1
On my laptop I have two branches, one called master and one called vs12up
The master branch was when the software was Visual Studio 2008, vs12up is converted to Visual Studio 2012.
On my laptop everything seems…
![](../../users/profiles/456638.webp)
Jeff
- 1,409
- 3
- 18
- 24
15
votes
2 answers
How to forcefully delete a remote branch in GitHub?
I have 2 remote branches :
- pending-issues-in-project
- new-issues-in-project
I tried to delete pending-issues-in-project like this :
git push origin :pending-issues-in-project, but i got the error :
error: unable to push to unqualified…
![](../../users/profiles/824217.webp)
Arpit Rawat
- 1,669
- 2
- 17
- 28
15
votes
2 answers
Configure a local branch for push to specific branch
Sorry if this question has been asked already.
Am cloning from a repo named "git_lab" which has a branch named "test"
When cloning i use "-b myname_test" to create a local branch named "myname_test" and local clone is named "myname_git_lab"
When i…
![](../../users/profiles/289715.webp)
Senthil A Kumar
- 8,034
- 13
- 41
- 53
15
votes
2 answers
git : how to specify a default remote push-to branch?
Suppose I have a tracking branch named 'abc' which tracks origin/master.
When I'm on 'abc' and do a git push, it pushes 'abc' to 'abc'.
How do I specify the remote push branch for it with just a 'git push'?
![](../../users/profiles/58743.webp)
Shawn
- 28,051
- 17
- 43
- 68
11
votes
2 answers
GIT Rebase a Branch that is collaborated on?
After reading this article, it makes sense to rebase to gather changes from the main branch on to my feature branch:
Git workflow and rebase vs merge questions
clone the remote repo
git checkout -b my_new_feature
..work and commit some stuff
git…
![](../../users/profiles/1207596.webp)
Zhao Li
- 3,184
- 5
- 28
- 43
9
votes
2 answers
Git: How to push from "no branch" to a new remote branch?
I did:
git co upstream/master # To no branch.
git commit -a -m "Trivial edit"
git push origin NewBranch
But got this:
$ git push origin ignore-netbeans-config
error: src refspec ignore-netbeans-config does…
![](../../users/profiles/145989.webp)
Ondra Žižka
- 36,997
- 35
- 184
- 250
9
votes
2 answers
fetch remote branch with the same name
I want to fetch a branch from a remote, but my branch name does not start with remote name, for example:
git checkout -b BRANCH origin/BRANCH
It work in some cases, but in some cases I get this error:
fatal: git checkout: updating paths is…
![](../../users/profiles/495838.webp)
saeedgnu
- 3,434
- 2
- 26
- 41
9
votes
3 answers
git: Why am I ahead of origin/master with X commits after I do 'git push'?
I am using a bare git repository on a server for backup, and push local changes there with 'git push' after doing 'git commit' locally.
'git status' tells me
# On branch master
# Your branch is ahead of 'origin/master' by X commits.
If I modify a…
![](../../users/profiles/25746.webp)
Eyvind
- 4,993
- 5
- 38
- 57
8
votes
3 answers
Head commit for all remote branches using Git
I know how to list the remote branches
$ git branch -a
And I know how to find the head commit hash of my current branch
$ git rev-parse HEAD
But I'm not sure how to list all the head commit hashes for all the remote branches. This is close to…
![](../../users/profiles/245777.webp)
milkplus
- 28,909
- 7
- 26
- 31
7
votes
2 answers
How to share a git feature (or topic) branch with multiple developers
I'm following the the workflow described here, as I found many references pointing to this page as a good workflow. As mentioned in the article, "feature" branches are shared between developers, but do not go to the central repository.
Let's say a…
![](../../users/profiles/210481.webp)
duduklein
- 8,344
- 10
- 40
- 52