Skip to content

0xc00010ff/git-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

git-alias

Simple aliases for git.

To install:

git clone https://github.com/0xc00010ff/git-alias &&
cd git-alias &&
make install

To verify, run git aliases

  • a : add
    Add a file to the index
  • amend : commit --amend
    Add currently staged changes to the previous commit (or just rename the previous commit)
  • aliases : config --get-regexp alias
    List all aliases
  • b : branch
    List current branches
  • ball : branch --all
    List all branches, including remote copies
  • brnach : branch
    Common typo for branch
  • c : commit
    Commit everything from the index into git history
  • clear : !clear && ls && git status
    A clean git status
  • co : checkout
    Point to a different branch
  • d : diff
    See the current unstaged (red) changes since last commit
  • drop : checkout --
    Delete the unstaged (red) changes
  • f : fetch
    Only fetch the current branch from upstream (but no merge)
  • graph : log --oneline --graph --decorate
    Pretty git logs
  • last : log HEAD~1..HEAD --oneline
    Print the last commit
  • lastdiff : diff HEAD~1 HEAD
    Show the difference between the last commit and the one before
  • list : log --oneline
    A condensed form of the commit log
  • mastiff : log --oneline main..HEAD
    Compare commits between this branch and main
  • new : checkout -b
    Compare commits between this branch and main
  • pr : Some heady bash script... view source for details Creates a pull request off the current branch. Make sure you pushed first!
  • pullrequest : Some heady bash script... view source for details Long form for the above.
  • remain : ! _current=$(git branch | sed -n -e "s/^\* \(.*\)/\1/p") && git checkout main && git pull && git checkout $_current && git rebase main
    This one is heavy. Pop over to main, pull, pop back to the current branch and rebase main. You might want to stash first.
  • rename : branch -m
    Rename the current branch
  • s : !clear && ls && git status
    A clean git status, same as clear
  • stage : add
    Add files to the staging area (green)
  • unamend : reset --soft HEAD@{1}
    Undo the amend you just did, if you did one
  • uncommit : reset HEAD~1 --soft
    Reset the previous commit's changes back into the staging area (green)
  • unstage : reset
    Move changes out of the stage (green) into the working area (red)

About

Simple aliases for everyday git

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published