Questions tagged [remote-branch]

142 questions
3
votes
2 answers

How to allow remove remote branches at gitolite and forbid non fast forward

We need to allow developers: 1) to create topic branches and save them at remote repo. 2) Do changes. 3) Do merge to 'development' branch. 4) Remove topic branch (git push origin :TestRemoteBranch). But we would rather forbid to use non fast…
Roman Ivanov
  • 2,477
  • 3
  • 20
  • 31
3
votes
1 answer

restore all refs from git bundle

How to restore all remote branches from backup (git bundle). Backup: $ git bundle create /tmp/dp --all $ git bundle list-heads /tmp/dp | head -n5 f37c9fc7f0ce121568f42fb01390b1862c67f308 refs/heads/master f37c9fc7f0ce121568f42fb01390b1862c67f308…
csgwro
  • 181
  • 2
  • 5
3
votes
2 answers

git pull from wrong remote branch

My origin has a fixes and a fixes_v3 branch. My client has just fixes. I do a git pull git+ssh:/.../mygitrepo and suddenly on my client I have all the fixes_v3 code in the fixes branch. Why on earth did this happen? Now I try git pull ...…
djechlin
  • 59,258
  • 35
  • 162
  • 290
3
votes
1 answer

Where to set the branch in mercurial?

I am new to the Mercurial and would like to seek some experienced advices about where to set branch under situation of my team's project. The project will be shared by 4 other members. I have a repository on my local machine at directory…
Cassie
  • 1,179
  • 6
  • 18
  • 30
2
votes
2 answers

Git : How to get name of the branch tracked by the current one?

In order to write a specific script, I need to check is the current branch has a tracked remote and what is the name of this remote. Is there a way to get only the name of the branch tacked by the current one, without having to parse git remote show…
Mac Moris
  • 21
  • 1
2
votes
1 answer

Why does deleting a remote branch by name produce an error while deleting by ref does not?

When I try to delete a non-existent remote Git branch by name, I expectedly get an error: $ git push origin --delete non/existent error: unable to delete 'non/existent': remote ref does not exist error: failed to push some refs to…
Eugene Yarmash
  • 142,882
  • 41
  • 325
  • 378
2
votes
1 answer

How to compare local master with remote master in Git?

I have made few changes in my remote code on github.com. Now, I need to compare my local master branch with origin. I am using below command to get the diff, but I don't see the diff on the terminal. git diff master origin/master If I use the below…
Vik
  • 59
  • 8
2
votes
2 answers

how to push all files in a folder to all git branches

I have a lot git branches. There's a directory/folder in which I keep apk files. But whenever I add a apk/file and push it (1. git add, 2. git commit -m "", 3. git push), It gets pushed to the local branch in which i'm working. Instead of this I…
Shirish Herwade
  • 11,461
  • 20
  • 72
  • 111
2
votes
2 answers

List all remote branches that are behind master

I have a garbage of feature branch in central repository apart from master. My master is up to date. Now, I want to know the list of branches that are lagging behind my master branch. I know individual branch selection in github/bitbucket has a…
LVR
  • 21
  • 1
2
votes
2 answers

Usage of updating a remote-tracking branch by a local branch

I know it is possible to create, update or delete a remote-tracking branch by content of a local branch of current repository. For example: $ git push . :refs/remotes/origin/master Which deletes remote-tracking branch. But is updating a…
hasanghaforian
  • 13,858
  • 11
  • 76
  • 167
2
votes
1 answer

Removing remote Git branch using JGit

I am trying to remove a remote branch called test. I don't get any errors while running this code but the remote branch is not getting removed. 'ans' is the destination including the branch id. This code worked for me when I used the full branch.…
user2775042
  • 509
  • 2
  • 6
  • 21
2
votes
1 answer

how to merge two more remote branches directly in git?

I tried to search this question, but none of them answered my question. Please let me give an example: I get two branches in the git server origin/master origin/feature Branch 'feature' is branched out from 'master', as everybody else is working on…
yang yu
  • 21
  • 1
  • 3
2
votes
1 answer

Git - Change tracking configuration of branches

I have the following branches (local and remote): origin/master origin/alter origin/alter_old master alter alter_old If I do git branch -vv I get: master 6aec3b5 [origin/master] blam alter 8c32a03 blaa1 alter_old 1669af7 [origin/alter:…
Nordico
  • 1,226
  • 2
  • 15
  • 31
2
votes
1 answer

git create branch with untracked files

I've a master branch with a .gitignore file with directory X listed in it. (X is not being tracked). When I try to add a branch tracking a remote using the command git checkout -b mybranch origin/mybranch The remote branch is tracking X directory,…
Surya
  • 1,139
  • 1
  • 11
  • 30
2
votes
1 answer

Push a branch to a remote on GitHub with the base branch set to a remote branch name

I have three branches on remote (master, development, featurebranch). What I wanted is that when I push branch1, it should try and push it to the development branch, or any kind of branches I prefer. I've seen examples of what I should do like…
Finks
  • 1,661
  • 2
  • 16
  • 25