version control - Comment supprimer une branche Git localement et à distance

Mots clés : gitversion-controlgit-branchgit-pushgit-remotegit

meilleur 4 Réponses version control - Comment supprimer une branche Git localement et à distance

vote vote

91

$ git push -d <remote_name> <branchname> $ git branch -d <branchname> 
$ git branch -d <branch_name> $ git branch -D <branch_name> 
$ git push <remote_name> --delete <branch_name> 
$ git push <remote_name> :<branch_name> 
$ git push origin :serverfix To git@github.com:schacon/simplegit.git  - [deleted]         serverfix 
# Fetch changes from all remotes and locally delete  # remote deleted branches/tags etc # --prune will do the job :-; git fetch --all --prune 
vote vote

84

git push origin --delete <branch>  # Git version 1.7.0 or newer git push origin -d <branch>        # Shorter version (Git 1.7.0 or newer) git push origin :<branch>          # Git versions older than 1.7.0 
git branch --delete <branch> git branch -d <branch> # Shorter version git branch -D <branch> # Force-delete un-merged branches 
git branch --delete --remotes <remote>/<branch> git branch -dr <remote>/<branch> # Shorter  git fetch <remote> --prune # Delete multiple obsolete remote-tracking branches git fetch <remote> -p      # Shorter 
git branch -rd origin/bugfix 
git push origin --delete bugfix 
# View just remote-tracking branches git branch --remotes git branch -r  # View both strictly local as well as remote-tracking branches git branch --all git branch -a 
git fetch origin --prune git fetch origin -p # Shorter 
git branch --delete --remotes origin/X git branch -dr origin/X # Shorter 
vote vote

72

git push origin --delete <your_branch> 
1: git branch -D <branch_name>  2: git branch --delete --force <branch_name>  # Same as -D  3: git branch --delete  <branch_name>         # Error on unmerge 
vote vote

69

git push --delete origin serverfix 
git push origin :serverfix 

Questions similaires