remote-branch

How to remove remote origin/refs/heads/master

我与影子孤独终老i 提交于 2019-11-28 22:45:32
问题 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 the unnecessary listing for origin/refs/heads/master ? I tried to do the following $ git push origin :refs/heads/master error: dst refspec refs/heads/master matches more than one. But as shown, this gives an error. 回答1: That's not actually a branch on the

Configure a local branch for push to specific branch

*爱你&永不变心* 提交于 2019-11-28 18:52:39
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 do "git pull" it automatically fetches and merges changes from "test" to "myname_test", but for git push, i need to specify the repo and branch name. $>git remote show git_lab Local branch configured for 'git pull': myname_test merges with remote test Is there a way where i can configure "local branch configured for 'git push'" so that i dont need to

fatal: The upstream branch of your current branch does not match the name of your current branch

回眸只為那壹抹淺笑 提交于 2019-11-28 16:58:22
After doing a checkout of the remote branch releases/rel_5.4.1 using the Git GUI, I'm seeing this unexpected error message when I try to push : fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote, use git push origin HEAD:releases/rel_5.4.1 To push to the branch of the same name on the remote, use git push origin rel_5.4.1 I don't know what Git is talking about. I probably want to push to origin releases/rel_5.4.1 since that's the branch which I checked out. So neither option seems correct to me. git

How do I list all remote branches in Git 1.7+?

南笙酒味 提交于 2019-11-28 14:54:50
I've tried git branch -r , but that only lists remote branches that I've tracked locally. How do I find the list of those that I haven't? (It doesn't matter to me whether the command lists all remote branches or only those that are untracked.) Dustin For the vast majority [1] of visitors here, the correct and simplest answer to the question "How do I list all remote branches in Git 1.7+?" is: git branch -r For a small minority [1] git branch -r does not work. If git branch -r does not work try: git ls-remote --heads <remote-name> If git branch -r does not work, then maybe as Cascabel says "you

Git fetch a branch once with a normal name, and once with capital letter

前提是你 提交于 2019-11-28 11:30:56
I'm fetching for remote branches and stuck in some sort of a loop. I fetch once and get: $ git fetch * [new branch] minorRelease/something-> origin/minorRelease/something And then I fetch again and get: $ git fetch * [new branch] minorRelease/Something-> origin/minorRelease/Something Same branch but with a capital S . I tried to delete the file from the following folder .git/refs/remotes/origin/minorRelease , but when fetching again, I get both and return to the loop above: $ git fetch * [new branch] minorRelease/Something-> origin/minorRelease/Something * [new branch] minorRelease/something->

Push a branch of a git repo to a new remote (github), hiding its history

久未见 提交于 2019-11-28 04:44:50
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 decided not to release, and release contains the cleaned-up version that we want to distribute. The problem is, if we just push the release branch to github, the proprietary components can be retrieved by looking through the revision history. I was considering creating a separate repository, copying the HEAD of relase into it, doing a git init , and

Push a branch of a git repo to a new remote (github), hiding its history

泄露秘密 提交于 2019-11-27 19:16:34
问题 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 decided not to release, and release contains the cleaned-up version that we want to distribute. The problem is, if we just push the release branch to github, the proprietary components can be retrieved by looking through the revision history. I was

git pull all branches from remote repository

梦想与她 提交于 2019-11-27 18:23:07
How do I pull all of the remote branches to my own repository? if I type: git branch -a I get a long list of branches, but if I type: git branch I see only 2 of them. How do I pull ALL branches into my local list? I know I can do: git checkout --track origin/branch-name but that pulls and checks out only one branch at a time. Any way to get it all done at once without that whole tedious work of running git checkout --track origin/branch-name over and over and over again? ps. I tried following commands, none of them made remote branches appear in my git branch list: git fetch --all git remote

Git: which is the default configured remote for branch?

痴心易碎 提交于 2019-11-27 16:37:05
I have a remote bare repository hub . I work only in the master branch. The last sentence of this error message below makes me wonder: How do I find out which is the "default configured remote for your current branch" ? And how do I set it? [myserver]~/progs $ git remote -v hub ~/sitehub/progs.git/ (fetch) hub ~/sitehub/progs.git/ (push) [myserver]~/progs $ git branch -r hub/master [myserver]~/progs $ cat .git/HEAD ref: refs/heads/master [myserver]~/progs $ git pull hub You asked to pull from the remote 'hub', but did not specify a branch. Because this is not the default configured remote for

Configure a local branch for push to specific branch

荒凉一梦 提交于 2019-11-27 11:43:09
问题 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 do "git pull" it automatically fetches and merges changes from "test" to "myname_test", but for git push, i need to specify the repo and branch name. $>git remote show git_lab Local branch configured for 'git pull': myname_test merges with remote