Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This gist adds aliases for the most used git commands.
- Open the .gitconfig file and append the below code to existing alias section.
- st = status
- ci = commit
- ad = add -A
- last = log -1 HEAD
- com = checkout master
- plm = pull origin master
- psm = push origin master
- co = "!f() { git checkout $1; }; f "
- pl = "!f() { git pull origin $1; }; f "
- ps = "!f() { git push origin $1; }; f "
- br = branch
- If there is no alias section, add below code to .gitconfig.
- [alias]
- st = status
- ci = commit
- ad = add -A
- last = log -1 HEAD
- com = checkout master
- plm = pull origin master
- psm = push origin master
- co = "!f() { git checkout $1; }; f "
- pl = "!f() { git pull origin $1; }; f "
- ps = "!f() { git push origin $1; }; f "
- br = branch
- Examples:
- git st
- git ci
- git ad // Stages all unstaged files
- git last // last commit
- git com // checks out master
- git plm // pulls master branch from origin
- git psm // pushes master branch to origin
- git co <branch_name> // checks out branch_name
- git pl <branch_name> // pulls branch with branch_name from origin
- git ps <branch_name> // pushes branch with branch_name to origin
- git br
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement