Why does git use 'rm' for remote and '-d' for branch deletion?
I find it confusing to that in git, to remove a remote you use 'remote rm'...
git remote rm myremote
...while the syntax for deleting a branch requires the -d (or -D) switch:
git branch -d mybranch
Is there a logical reason for this inconsistency (which could perhaps assist me in remembering it correctly)?
I created a local branch which I want to 'push' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch. However, my workflow is slightly different.
I'd like to delete a remote branch from my central git repository. The usual advice is to do 'git push origin :branchname' or 'git push origin :heads/branchname'. But when I try that, I get this error
This question already has an answer here: Checkout remote Git branch 11 answers I have a remote branch: git branch -a *master remotes/origin/develop Can I checkout to remotes/origin/develop ?
Subtrees in Git work nicely although some git commands remain to be supported for subtrees. Here's the question: How to make the subtree pull from a different remote branch like stable or integra
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
we are using git in Team Foundation Service, and we are trying to find a way to delete a remote branch by running the following command. git push origin --delete TheBranchName The remote server keep
I have recently extracted a few subdirectories from a shared git repository with git filter-branch --subdirectory-filter foodir -- --all Now I have the subdirectories still left in the central shared
I could use a hand with learning how to push a local branch to a remote branch. Please see below. Help much appreciated! The local branch was created after cloning the repo then doing $ git checkout -
I'm using this example on publishing a website w/ git post receive hooks. The hook pretty much clones the bare repo into a temporary directory, and after generating the site, removes that temporary gi
git-fetch manual page says: git fetch remote_repo will update remote-tracking branches of all branches from the remote repository. What if I only need fetch a single remote branch? I try to run: gi
I have created branch with git checkout -b mybranch. It seems that something went wrong, and now I can't delete it using git branch -D mybranch. It says: error: branch 'mybranch' not found.
The Scenario: I'm working on a remote git repository with a team of say 20+. Branches are made, committed to and merged to master frequently. One colleague and I worked together on a branch for a coup
git branch -r shows a bunch of branches I deleted from another computer: -bash-4.1$ git branch -r origin/access-qa origin/add-search-efforts origin/align-buttons origin/enable-features origin/fix-code
Aim : To delete a remote branch named 'branchname' Steps I used to do was: [first approach] git branch -d branchname git push origin :branchname Today I tried to delete using the same above steps, b
How do you stop tracking a remote branch in Git? I am asking to stop tracking because in my concrete case, I want to delete the local branch, but not the remote one. Deleting the local one and pushing
I just added the following line to my .gitignore *.pyc 1) I then ran the command git rm -r --cached *.pyc but it did not work recursively and I instead got the error fatal: pathspec 'RepoName.pyc' d
I would like to know if there is any command available to get the SHA id of a particular file on a given specific git branch on the GIT remote server? Thanks, Srinivas
I have a strange git scenario: I've been developing on master, and ive noticed that when my CI clones down and attempts to modify a git repository, it doesn't see master in the refspec. Thus, the co
This question already has an answer here: Force Git to overwrite local files on pull 25 answers I want to sync the local branch with the remote git branch. I tried to do git pull but it fails w
I know that git provides the 'git rm' and 'git mv' to remove/move files or directories. But, I can't see the practical use case for this. Normally, I just mv or rm the files or whatever in the comman
I am using git and git-repo for my project. I see when I try to delete my local branch which I am currently on using git command git branch -D branch_name It shows me error which I am expecting, as
I have a local branch that is tracking of a remote branch on git. At some point I update file 'x.out', but while working on this branch I try to pull from the server latest changes. Somebody else alre
I am trying to make a hook on a remote --bare repository that will copy the source code I send from a local git, in different folders according the branch I'm sending to. I have 3 branches on local: m
I am using SmartGit and I can't seem to delete my remote branches. When I try to delete them, it would fail and the error message that I get is along the lines of Could not delete branch from head.
I had a local topic branch based off a remote branch on the git repo: 1 - 2 - 4 - 5 - 9 - 11 master \ 3 - 6 - 8 - 12 remote branch \ 7 - 10 my topic The remote branch was recently rebased off master:
Why does git:// works $ git clone git://github.com/schacon/grit.git Cloning into 'grit'... ... Checking connectivity... done. but git@ does not $ git clone email@example.com:schacon/grit.git mygrit Clon
I built a repository using git clone --mirror <url> I want to remove some remote branches, but I get the following: $ git push origin :b error: --mirror can't be combined with refspecs ... or
I have checked out a svn repository using git svn. Now I need to checkout one of the branches and track it. Which is the best way to do it?
Quick sanity check - I wanted to create a new remote branch for myself. I want to do the following: git clone firstname.lastname@example.org:orange/orange.git git branch foo git checkout foo git push foo foo I'd lik
I'm not exactly sure how this happened, but we have a branch on our remote repository that has a space in it's name: remotes/origin/Dev 3 I'm trying to remove this branch using the following command,
I recently delete all file from current branch, with rm --cached command without delete .git folder. Then staged just one file in current branch. But when I try to push that file to remote repository,
Git shows me this when I do git status # Changes not staged for commit: # (use git add/rm <file>... to update what will be committed) # (use git checkout -- <file>... to discard change
The git server I am trying to pull has a new branch . (call it branch-9) In my local, I don't have that and I do I pull it to my local computer? should I run this? $git checkout -b branch-9 $git pull
I'm looking for a snippet that will give me the pseudo-remote upstream branch used by git-svn for the currently checked out branch. Let's say my local repository was cloned from svn with git svn clo
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 c
I want to switch to the remote branch in Git. What is the difference these commands? git checkout -b feature1 origin/feature1 and git checkout --track origin/feature1
I'm running Git Extensions 2.32 on Git For Windows (previously known as msysgit) 1.7.10.msysgit.1. Another user has created a new branch and pushed it to the remote repository. I want to fetch that ne
I have a master branch and a es branch. es has been reconstructed locally: git checkout master git checkout -b es2 git cherry-pick A C E D git branch -D es git checkout master git branch -m es2 es wh
I'm working with Rubygems, and it's caching files in git a lot. The easy solution is just to run git rm -rf . --cached, but when I run it, this message appears: fatal: pathspec '' did not match any fi
Imagine, I have several branches: master, a, b, c ... Now I'm in master branch and git pull. This fetches all changes from remote server into origin/master, origin/a, origin/b ... branches and merge
I have a local develop branch dev and a remote master branch. For the dev branch, I have a quite complicated commit history(nearly 20 successive commits). I tried to use git rebase -i origin/m
So here's the situation. I created a local branch. Then I pushed that local branch to github. So github now has two branches. Now I want to merge the two branches together both locally and on github.
When I do git status this is what I see: $ git status # On branch master # Your branch is ahead of 'github/master' by 1 commit. # (use git push to publish your local commits) # # Changes not staged
I have a problem with a git repo that is shared between multiple developers. A branch seems to have gone missing (kind of) and when I try to push to the remote repo with this branch I receive the foll
I try to remove the git remote branch on the bitbucket by git push command: qty:workspace qrtt1$ git push origin :my_branch remote: fatal: bad object 0000000000000000000000000000000000000000 remote: b
I've taken the following steps so far: Cloned a remote Git repo Branched the master branch to an experimental edited/tested/committed code in the experimental branch Now, I'm not ready to merge expe
I have two branches, master and mybranch in a git repository. In a local folder cloned from the git repository before adding the second branch, I can only see the first branch, as expected: xxx$ git b
I already read this question: Modified files in a git branch are spilling over into another branch and I understand (I hope) how git works. Could you explain me why it works like that, I do not unders
I do not want to rename a remote branch, as described in Rename master branch for both local and remote Git repositories. Instead, I want to use simplest way to rename local branch, which is not pushe
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