Skip to content

Add tips to delete local branches that has been squash and merged in the remote #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master)
* [Archive the `master` branch](#archive-the-master-branch)
* [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message)
* [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote)
* [Prunes references to remove branches that have been deleted in the remote.](#prunes-references-to-remove-branches-that-have-been-deleted-in-the-remote)
* [Delete local branches that has been squash and merged in the remote.](#delete-local-branches-that-has-been-squash-and-merged-in-the-remote)
* [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision)
* [Visualize the version tree.](#visualize-the-version-tree)
* [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs)
Expand Down Expand Up @@ -442,7 +443,7 @@ git stash

__Alternatives:__
```sh
git stash save
git stash push
```

## Saving current state of unstaged changes to tracked files
Expand All @@ -458,7 +459,7 @@ git stash --keep-index


```sh
git stash save --keep-index
git stash push --keep-index
```

## Saving current state including untracked files
Expand All @@ -469,17 +470,23 @@ git stash -u

__Alternatives:__
```sh
git stash save -u
git stash push -u
```


```sh
git stash save --include-untracked
git stash push --include-untracked
```

## Saving current state with message
```sh
git stash save <message>
git stash push -m <message>
```


__Alternatives:__
```sh
git stash push --message <message>
```

## Saving current state of all files (ignored, untracked, and tracked)
Expand All @@ -495,7 +502,7 @@ git stash --all


```sh
git stash save --all
git stash push --all
```

## Show list of all saved stashes
Expand Down Expand Up @@ -645,7 +652,7 @@ git archive master --format=zip --output=master.zip
git add --all && git commit --amend --no-edit
```

## Prunes references to remote branches that have been deleted in the remote.
## Prunes references to remove branches that have been deleted in the remote.
```sh
git fetch -p
```
Expand All @@ -656,6 +663,11 @@ __Alternatives:__
git remote prune origin
```

## Delete local branches that has been squash and merged in the remote.
```sh
git branch -vv | grep ': gone]' | awk '{print <!-- @doxie.inject start -->}' | xargs git branch -D
```

## Retrieve the commit hash of the initial revision.
```sh
git rev-list --reverse HEAD | head -1
Expand Down Expand Up @@ -1139,14 +1151,9 @@ git config [--global] --edit
git blame -L <start>,<end>
```

## List all Git variable.
```sh
git var -l
```

## Show a Git specific variable.
## Show a Git logical variable.
```sh
git var <variable>
git var -l | <variable>
```

## Preformatted patch file.
Expand Down
Loading