Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hhebig/664fcc4456b68bccf90f80f0de70b2d6 to your computer and use it in GitHub Desktop.

Select an option

Save hhebig/664fcc4456b68bccf90f80f0de70b2d6 to your computer and use it in GitHub Desktop.

Revisions

  1. hhebig revised this gist Aug 23, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ## Discover unwanted branchs
    From http://www.darkcoding.net/software/cleaning-up-old-git-branches/

    1. Switch to the main branch, usually 'develop':
    1. Switch to the main branch:

    git checkout develop
    git checkout master

    2. Get a list of fully merged branches:

  2. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    # How to prune unwanted ``git`` branches
    # How to prune unwanted git branches

    ## Discover unwanted branchs
    From http://www.darkcoding.net/software/cleaning-up-old-git-branches/

    1. Switch to the main branch, usually ``develop``:
    1. Switch to the main branch, usually 'develop':

    git checkout develop

  3. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    # How to prune unwanted git branches
    # How to prune unwanted ``git`` branches

    ## Discover unwanted branchs
    From http://www.darkcoding.net/software/cleaning-up-old-git-branches/

    1. Switch to the main branch, usually 'develop':
    1. Switch to the main branch, usually ``develop``:

    git checkout develop

  4. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,17 @@
    # How to prune unwanted git branches

    ## Discover unwanted branchs
    From http://www.darkcoding.net/software/cleaning-up-old-git-branches/

    1. Switch to the main branch, usually 'develop':

    git checkout develop

    2. Get a list of fully merged branches:

    git branch -a --merged

    ## Prune unwanted branches
    From http://www.aaronwest.net/blog/index.cfm/2011/6/7/Git-Workflows-Archiving-Old-Branches

    1. Tag the unwanted branch:
  5. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # How to prune unwanted git branches
    From http://www.aaronwest.net/blog/index.cfm/2011/6/7/Git-Workflows-Archiving-Old-Branches

    1. Tag the unwanted branch:

  6. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -9,14 +9,14 @@
    git branch -d sprintjuly2010

    3. Push the branch deletion to origin:
    ```
    git push origin :sprintjuly2010
    ```

    git push origin :sprintjuly2010

    4. Push the new tag to origin:
    ```
    git push --tags
    ```

    git push --tags

    5. Restore a deleted branch from a tag:
    ```
    git checkout -b sprintjuly2010 archive/sprintjuly2010
    ```

    git checkout -b sprintjuly2010 archive/sprintjuly2010

  7. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    # How to prune unwanted git branches

    1. Tag the unwanted branch:
    ```
    git tag archive/sprintjuly2010 sprintjuly2010
    ```

    git tag archive/sprintjuly2010 sprintjuly2010

    2. Delete the branch:
    ```
    git branch -d sprintjuly2010
    ```

    git branch -d sprintjuly2010

    3. Push the branch deletion to origin:
    ```
    git push origin :sprintjuly2010
  8. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -8,17 +8,14 @@ git tag archive/sprintjuly2010 sprintjuly2010
    ```
    git branch -d sprintjuly2010
    ```

    3. Push the branch deletion to origin:
    ```
    git push origin :sprintjuly2010
    ```

    4. Push the new tag to origin:
    ```
    git push --tags
    ```

    5. Restore a deleted branch from a tag:
    ```
    git checkout -b sprintjuly2010 archive/sprintjuly2010
  9. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -10,10 +10,16 @@ git branch -d sprintjuly2010
    ```

    3. Push the branch deletion to origin:
    git push origin :sprintjuly2010
    ```
    git push origin :sprintjuly2010
    ```

    4. Push the new tag to origin:
    git push --tags
    ```
    git push --tags
    ```

    5. Restore a deleted branch from a tag:
    git checkout -b sprintjuly2010 archive/sprintjuly2010
    ```
    git checkout -b sprintjuly2010 archive/sprintjuly2010
    ```
  10. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,13 @@
    # How to prune unwanted git branches

    1. Tag the unwanted branch:
    git tag archive/sprintjuly2010 sprintjuly2010

    ```
    git tag archive/sprintjuly2010 sprintjuly2010
    ```
    2. Delete the branch:
    git branch -d sprintjuly2010
    ```
    git branch -d sprintjuly2010
    ```

    3. Push the branch deletion to origin:
    git push origin :sprintjuly2010
  11. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    # How to prune unwanted git branches

    1. Tag the unwanted branch:

    git tag archive/sprintjuly2010 sprintjuly2010

    2. Delete the branch:
  12. @zkiraly zkiraly revised this gist May 3, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # How to prune unwanted git branches

    1. Tag the unwanted branch:

    git tag archive/sprintjuly2010 sprintjuly2010

    2. Delete the branch:
  13. @zkiraly zkiraly created this gist May 3, 2014.
    16 changes: 16 additions & 0 deletions procedure-to-archive-git-branches.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # How to prune unwanted git branches

    1. Tag the unwanted branch:
    git tag archive/sprintjuly2010 sprintjuly2010

    2. Delete the branch:
    git branch -d sprintjuly2010

    3. Push the branch deletion to origin:
    git push origin :sprintjuly2010

    4. Push the new tag to origin:
    git push --tags

    5. Restore a deleted branch from a tag:
    git checkout -b sprintjuly2010 archive/sprintjuly2010