Alias to check if merging [branch]
into the current branch can be done as a fast-forward merge. (i.e. checks if current branch is an ancestor of [branch]
)
See Check If We Can Do a Git Fast-Forward Merge.
Alias for git branch --delete @{-1}
to delete the previous branch.
See Git Previous Branch.
Alias for git push origin --delete $(git rev-parse --abbrev-ref HEAD)
to delete the remote branch with the same name as the current branch from the remote origin.
Decorated version of git log --oneline --graph
.
See Improve Git Log.
Alias to open a GitHub URL for the current repo to create a pull request from the current branch into the [targetBranch]
. If the [targetBranch]
is not provided, the PR will target the default branch on the repo.
Note: This requires the upstream reference is defined for the current branch, so using git push --set-upstream
(or git push -u
) when pushing the branch is necessary.
See Git Alias Open Pull Request on GitHub.
Alias for git push --force-with-lease
.
Alias to create a commit and pre-fill the commit message with the most recent commit message entered. This is useful to recover a commit message when commit validation fails.
See Recover failed Git commit message
Alias for git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD)
.
See There is no tracking information for the current branch.
Set commit.verbose = true
to display the changes in the comments of the commit.
See Git Preview Changes in Commit Message.
Set rebase.autosquash = true
to move fixup commits to the appropriate position (and mark them fixup) when doing an interactive rebase.
- Clone this repo into a location (e.g.
~/salcode-git
)
git clone https://github.com/salcode/salcode-git.git ~/salcode-git
- Modify your default Git config file (
~/.gitconfig
) to include the config from this project. e.g. add
[include]
path = ~/salcode-git/gitconfig