![](/style/images/good.png)
![](/style/images/bad.png)
Easier use of Git
source link: https://michelkraemer.com/easier-use-of-git/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Easier use of Git
I’m using Git as the version control system for my projects for some time now. Since the graphical user interfaces are not very mature yet and I like having full control over everything, I’m using Git on the command line (i.e. Bash). In order to avoid entering the same commands all over again, I wrote some Bash aliases and functions which ease the use of Git.
The simplified commands can be downloaded from my Github repository. Instructions for installing and usage can be found in the README.
This is a short summary of the most used commands:
add
Verbose add (executes git add -v
and then git status
). All parameters will be forwarded to git add
.
Example: add -p foobar.txt
commit
Alias for git commit
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$'
log
Alias for git log
pull
Executes git pull --rebase
and then displays all commits since the last pull in a short format.
push
Alias for git push
st
Alias for git status
The commands have been tested unter msysgit, but they should also work on other platforms. A complete list can be found in the README.
In the future I may add further commands. I would appreciate any feedback.
Finally, I want to thank Simon Templer and Simon Thum for their ideas!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK