Skip to content

Linutux/gitaliases

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Gitaliases

These are some bash aliases and functions that make the average git user's life easier. The commands have been tested under msysgit but they should work on other platforms too.

Installation

Clone the repository into your home directory:

cd ~
git clone git://github.com/michel-kraemer/gitaliases.git

Include gitaliases.sh in your .bashrc:

echo source ~/gitaliases/gitaliases.sh >> ~/.bashrc

Usage

The following aliases are provided:

add

Verbose add (executes git add -v and then git status). All parameters will be forwarded to git add.

Example:
  add -p foobar.txt
branch

Alias for git branch

checkout

Alias for git checkout

cherry-pick

Alias for git cherry-pick

commit

Alias for git commit

fetch

Alias for git fetch

g

Alias for git

gadd

Pipes the output of git ls-files to grep to add only those files that match a given pattern. All parameters (including the pattern) will be forwarded to grep. Like add this command is verbose and calls git status at the end.

Example:
 gadd -i '\.java$'
greset

Pipes the output of git ls-files to grep to reset only those files that match a given pattern. All parameters (including the pattern) will be forwarded to grep. Like reset this command calls git status at the end.

Example:
 greset 'bin'
log

Alias for git log

merge

Alias for git merge

pull

Executes git pull --rebase and then displays all commits since the last pull in a short format.

push

Alias for git push

rebase

Alias for git rebase

reset

Verbose reset (executes git reset -v and then git status). All parameters will be forwarded to git reset.

st

Alias for git status

stash

Alias for git stash

Acknowledgements

Special thanks to Simon Templer and Simon Thum for their input!

License

This work is licensed under the MIT license:

Copyright (c) 2010 Michel Kraemer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Bash aliases and functions for easier use of git. Based on code by Michel Krämer but extended with some more commands and shortened the existing commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%