How do you remove an invalid remote branch reference from Git?
In my current repo I have the following output:
$ git branch -a
I want to delete 'remotes/public/master' from the branch list:
$ git branch -d remotes/public/master
error: branch 'remotes/public/master' not found.
Also, the output of 'git remote' is strange, since it does not list 'public':
$ git remote show
How can I delete 'remotes/public/master' from the branch list?
Update, tried the 'git push' command:
$ git push public :master
fatal: 'public' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Solution: The accepted answer had the solution at the bottom!
git gc --prune=now
So if I have website project Foo which has a reference to class library project Bar, how do I remove that reference? Thanks David
In another question it was recommend that I try resetting a remote tracking branch to an earlier commit and performing an import a second time. I can't figure out how to do that! I can reset master, b
Is there any way to block code push directly to master ? I tried by adding a script in .git/hooks/update #!/bin/sh if [ $USER != git-repo-admin ]; then if [ $1 == refs/heads/master ]; then echo M
A colleague pushed a new remote branch to origin/dev/homepage and I cannot see it when I run: $ git branch -r I still see preexisting remote branches. I assume this is because my local remote refs a
Possible Duplicate: Change the current branch to master in git I have two branch in my git repo: master seotweaks (created originally from master) I created seotweaks with the intention of quick
I have 2 local git archives in /a and in /b which were cloned from remotes/origin. There is a new branch z on /b How can I track and fetch branch z from archive /a ? I tried this: cd /a git remote add
My remote Git repository has 3 branches: master develop news When a dev change he will branch off develop such as issue123. When he finished changing, he will push to remote issue123. I will merge
I have remote origin with branches a, b and local branch a. I have finished working on local-a, and pushed it to remote-a. I now want to create a local branch b-myUserName based on remote b. How do I
Say that I'm on my feature branch XXXX and issuing a git pull bad_remote master here is a BAD thing to do (in the way our workflow and branches are set up, of course). Is there a way to tell git (or v
I've got a 2 web servers, one testing and one live. Both have their codebases managed with git. I develop on the testing server, then push the changes from a master branch on the testing server to the
I have deleted and pushed a branch, but it is still showing in branch -r for other users: serverAlpha $ git push origin --delete origin/issue186 serverAlpha $ git push serverBeta $ git pull serverBeta
I made 5 commits to Master branch when bug hunting on a private project and pushed them to the remote origin (my own private vps). Then I saw that commits 4 and 5 were going to cause trouble elsewhere
It seems that we could use git branch -r or git branch -a to see remote branches. However, when I git clone my repo on GitHub, and then added a branch on GitHub, and tried the commands above, I can'
I'm very new to git. I have these 2 branches on my remote repository (github) development , master How do I merge development into master on the remote repository? I've tried git merge development and
When I use bash autocompletion in Git, it keeps showing me branches of old remotes that I don't have anymore. When I do a git branch -la it shows those old remotes and branches while a git branch -l w
Occasionally, my git ls-remote statement is returning a 401 Unauthorized status over HTTP, but not always. How do I trap this error status in Bash so that I don't proceed in my Bash script if I get
my current workflow to deploy code is to branch a releases branch from master when i believe the code is in a stable state. on my production side, i do a simple git fetch origin and than check out m
I'm having an issue with VS2013 which I had connected to my visual studio online account, and was using TFS source control just fine up until I installed Git. Now it seems that Microsoft Git Provider
So on Computer A, I did the following. git branch test git push On a different machine Computer B, I pull the changes and track the remote branch test git pull --all git checkout -t origin/test all
Is it possible to remove files from a Git repository branch, while another branch is checked out? I'd like to do this in order to resolve some conflicts with files that are .gitignore'd in the checked
I would like to check which of my local branch are closed on remote server and remove them from my local list - is there such git (or any other e.g.bash) command? My current flow: git branch to list
I know how to revert to older commits in a Git branch, but how do I revert back to a branch's state dictated by a tag? I envision something like this: git revert -bytag Version 1.0 Revision 1.5 Is
I have a newbie git question. Lets say my repository picture starts off like this: A <-- B <-- MASTER | A <-- B <-- O/M I make some changes to local master and in the meanwhile someone up
I'am using git as scm of choice but have to use a svn-repo. I can create a svn-remote-branch like this: git svn branch the_branch But how can i delete the remote branch?
I'm using git-svn to work against my company's central svn repository. We've recently created a new feature branch in the central repo. How do I tell git about it? When I run git branch -r I can only
I have 2 git branches: master and experimental. Experimental became good, I want to make it the master. I figured I would rename to shuffle things around, but here is what I got: nutebook:Stuff nathan
I have a master branch and branched out from it to a build branch. I cloned this repository to a different machine. I created a branch my_build to track the remote build branch. Now i have few commit
I was pulling in my .emacs directory, and hit the following conflict: CONFLICT (add/add): Merge conflict in elisp/dired-details+.el Git status showed the following: Unmerged paths: # (use git add/r
I recently used git svn branch to create a branch (in both Subversion and git). I noticed that (for some reason I'm not sure about; maybe a bug or maybe I created the branch incorrectly?) the git comm
If I create a new branch, make a few commits, and then decide, wow, I've done nothing good here, and I delete the branch (git branch -d branchname) do those few commits go away too? As in, do they d
I'm getting crazy with Git :) I have 2 branches : master and dev I want to create a feature branch from the dev branch Currently On branch dev, I do : $ git checkout -b myfeature dev ... (some work
I am trying to make an alias to delete a remote branch but I can't seem to get it, here is my latest attempt that I really expected to work but no luck. rmrb = !git push origin :$1 I also tried, rmrb
How do I tell, given an arbitrary reference, whether it is a branch, a tag or something else?
Is there a way to pass git filter-branch a regular expression to remove files/directories permanently from the history?
Does anyone know how to get the latest SHA of a given branch from outside a git repository? If you are inside a git repository, you can do: git log origin/branch_X | head -1 However, I am not inside
I am trying to checkout a remote branch: Somebody pushed a branch called test with git push origin test to a shared repository. I can see the branch with git branch -r. But how can I get this branch?
I was wondering how do you remove objects from an NSMutableArray, cause right now I use [astroids removeFromSuperview]; but it just gets rid of the image on screen but the instance itself is still pre
I've been trying really hard to remove a file with sensitive data from my git repository using this excellent page (among others): http://help.github.com/removing-sensitive-data/ the primary line bein
This question already has an answer here: How do I remove local (untracked) files from my current Git branch? 9 answers How can I clear my working directory in git?
after checkout to the desired branch: git checkout feature/myBranch I want to pull the project contained in this branch to my local repository, how can i do that please.
I have a local repository cloned from a remote one. When I do: git branch -a I get: * add-real-testcases couchdb_1.1.0 master remotes/origin/HEAD -> origin/master remotes/origin/couchdb_1.1.0 Now
Is there any way to modify central repository's configuration to disallow any remote pushing to master branch (using git)? It would only be updated via branch merging by a release owner. It is possib
I have a local branch test, and I want to rebase off of the remote branch test, how would I do this? I have tried git rebase origin test, but the changes someone pushed a short while ago arent being r
I'm just learning Git and would like to remove my first project from git gui.
How can I see the diff between a local branch and a remote branch?
git push origin master Total 0 (delta 0), reused 0 (delta 0) error: unable to resolve reference refs/heads/master: Permission denied remote: error: failed to lock refs/heads/master To git@remote-repo
Somehow during my SSH configuration (for GitHub), Tortoise Git has created a remote configuration with a blank name. Neither Tortoise nor Git command line will allow me to remove it because Git requ
Git is making me pull my hair out. I know how to create a local branch that tracks a remote branch, but I want to create a remote branch which copies another remote branch, and then track. Creating a
Usually when I do git pull or git status it automatically fetches and merge the data from the remote branch, and show the local commits that can be pushed on that branch. A new branch have been create
I have been working on my develop branch. I checked out branch 'branch-xxx', commit my changes and then merged the branch on develop, only to find out that this piece of code is buggy! How can I undo