Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stas00/git-tools
helper git tools
https://github.com/stas00/git-tools
git github
Last synced: 15 days ago
JSON representation
helper git tools
- Host: GitHub
- URL: https://github.com/stas00/git-tools
- Owner: stas00
- License: apache-2.0
- Created: 2019-01-22T02:42:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T04:49:44.000Z (about 1 year ago)
- Last Synced: 2024-10-04T18:35:04.198Z (about 1 month ago)
- Topics: git, github
- Language: Shell
- Size: 51.8 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git Tools
Various helper tools for working with git and github:
- [git cheat-sheet](./git.txt) - various solutions to git usage
- [how to make PR + tool to create PR branch](./how-to-make-pr/)
- [create TOC in `.md` files](./github-markdown-toc/)
- [rebase/merge a local branch with origin master](./git-rebase/)
- [git targets for Makefiles](./make/)Useful aliases:
Show a diff of all files modified in the current branch against HEAD:
```
alias brdiff="def_branch=\$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'); git diff origin/\$def_branch..."
```Same, but ignore white-space differences, adding `--ignore-space-at-eol` or `-w`:
```
alias brdiff-nows="def_branch=\$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'); git diff -w origin/\$def_branch..."
```List all the files that were added or modified in the current branch compared to HEAD:
```
alias brfiles="def_branch=\$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'); git diff --name-only origin/\$def_branch..."
```Once we have the list, we can now automatically open an editor to load just added and modified files:
```
alias bremacs="def_branch=\$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'); emacs \$(git diff --name-only origin/\$def_branch...) &"
```