Skip to content

A collection of shell commands to streamline your Git workflow and maintain a clean, understandable Git history.

License

Notifications You must be signed in to change notification settings

redrambles/git-glider

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-glider 🪂

A collection of shell commands to streamline your Git workflow and maintain a clean, understandable Git history.

Getting started

Install with curl

sh -c "$(curl -fsSL "https://raw.githubusercontent.com/krystalcampioni/git-glider/main/install.sh?$(date +%s)")"

or

bash <(curl -fsSL https://raw.githubusercontent.com/krystalcampioni/git-glider/main/install.sh)

run gitGlider --help for a full list of commands and aliases

Functions and Aliases

Functions

gcmsgn

git commit -m --no-verify

runs git commit skipping pre-commit checks

gcmsgn "Your commit message"

pushs

Pushes the current branch to the origin with --force-with-lease

pushs

rebaseLast

Starts an interactive rebase of the last num_commits commits.

rebaseLast 4

undoLast

Undoes the last num_commits commits and leaves the changes in the staging area.

undoLast 3

openpr

Opens the browser to compare the current branch to the main branch on Github

openpr

squashRange

Squashes a range of commits between hashA and hashB into a single commit with a new commit message.

⚠️ hashA has to be older than hashB

squashRange <hashA> <hashB> "optional new commit message"

squashLast

Squashes the last num_commits into a single commit with a new commit message.

squashLast 2 "optional new commit message"

Aliases

gup

git pull --rebase

fetches the updates from the remote repository and applies your local changes on top of those updates.

gcmsg

git commit -m

allows you to commit changes with a message.

ga

git add

stages changes for the next commit.

gst

git status

shows the status of changes as untracked, modified, or staged.

gups

git pull origin main --rebase

fetches updates from the main branch of the origin remote and applies your local changes on top.

logp

git log -p

which shows commit logs and diff about what was modified.

glog

git log --oneline --decorate --graph

shows a decorated, one-line commit history with a graph illustrating branch merges.

gclean

git clean -f -d

removes untracked files and directories.

rewordLast "new message"

git commit --amend --message

allows you to change the message of the most recent commit.

undo

git reset HEAD~

Undoes the last commit and leaves the changes in the working area.

addToLast n

Performs a git add . && git commit --amend --no-edit

Stages all changes and ads them to the most recent commit without changing the commit message.

backUpBranch

Performs the equivalent of git checkout -b <current-branch-name>_backup && git checkout -

Creates a backup of your current branch without leaving your current branch

stashByName

Saves changes to the stash with a name. Includes untracked by default.

stashByName <stash_name> <optional --no-untracked>

applyStash

Applied the stash by its saved name.

applyStash <stash_name>

popStash

Pops the stash by its saved name.

popStash <stash_name>

fileFromStash

alias: ffs

Finds the path to the file name provided and applies the changes to the working area. If no stash index is provided it will default to the last stash

fileFromStash <filename> <optional-stash-id>

Contributing

Contributions are welcome! 💪 If you have a command or alias that has improved your Git workflow, please consider sharing it with the community.

Perfect pairing 🍷

This project loves Oh My Zsh, a delightful community-driven framework for managing your Zsh configuration. Some of the aliases used in this project are defined in Oh My Zsh. If you haven't installed it yet, we highly recommend checking it out to enhance your terminal experience. Visit https://ohmyz.sh to learn more. ❤️

About

A collection of shell commands to streamline your Git workflow and maintain a clean, understandable Git history.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 95.9%
  • JavaScript 3.2%
  • HTML 0.9%