Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
git:crib [2019/12/04 10:00]
admin [Get existing remote branch]
git:crib [2019/12/04 10:06] (current)
admin [Remove obsolete tracking branches]
Line 28: Line 28:
   * ''​git checkout %%--%%track origin/​remote_branch_name''​   * ''​git checkout %%--%%track origin/​remote_branch_name''​
  
-==== Remove obsolete tracking ​branches ====+==== Branch deletion ==== 
 + 
 +=== Local branches === 
 +  ** ''​git branch -d <​branch_name>''​ 
 +  .. ''​-D''​ to force deletion in the presence of local-only changes 
 + 
 +=== Remote branches === 
 +https://​stackoverflow.com/​questions/​2003505/​how-do-i-delete-a-git-branch-locally-and-remotely 
 +  ** ''​git push -d origin <​branch>''​ 
 +  .. (Substitute ''​origin''​ for a different remote name if required). 
 +=== Obsolete tracking branches ​===
 https://​stackoverflow.com/​questions/​7726949/​remove-tracking-branches-no-longer-on-remote https://​stackoverflow.com/​questions/​7726949/​remove-tracking-branches-no-longer-on-remote
   * ''​git remote prune origin''​   * ''​git remote prune origin''​