https://github.com/cdce8p/git-custom-commands
Custom git command scripts
https://github.com/cdce8p/git-custom-commands
git git-commands
Last synced: 9 months ago
JSON representation
Custom git command scripts
- Host: GitHub
- URL: https://github.com/cdce8p/git-custom-commands
- Owner: cdce8p
- License: mit
- Created: 2021-10-27T13:51:32.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-12T18:33:57.000Z (over 3 years ago)
- Last Synced: 2025-02-06T05:24:53.122Z (10 months ago)
- Topics: git, git-commands
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Custom Git commands
## Requirements
* Install `github cli`: https://cli.github.com
* Install [Github Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension
* Add `bin` to `PATH`
## Usage
```bash
# Checkout PR using github cli
gh pr checkout 1234
# Add config value for 'github.vscode-pull-request-github' extension
# Rename branch to 'pr//
git vsc
# Both can also be combined
git vc 1234
# Remove branch and remote
git vsc-delete
```
## Git config
Set `push.default = upstream` to target the correct branch when using `git push`.
https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault
```bash
git push.default upstream
```
## How to
- Create new file in `bin`
- `chmod +x `
## Helpful Links
- http://thediscoblog.com/blog/2014/03/29/custom-git-commands-in-3-steps/
- https://gitbetter.substack.com/p/automate-repetitive-tasks-with-custom
- https://devhints.io/bash