Information Technology Reference
In-Depth Information
The commands shown in Listings 2-5 and 2-8 through 2-13 are quite long to type. You
would like to define aliases that would be easier to type while returning the same out-
put.
Solution
Open the command line and go to your home directory. Using Linux, Mac, or a bash
command line on Windows it can be done with:
$ cd
If you use a standard Windows' command line, then try:
$ cd %userprofile%
Start the editor of the text files and open the file .gitconfig . If you use vi , you
can do it with:
$ vi .gitconfig
At the bottom of the file append the contents of Listing 2-14 . Save the file and exit
the editor.
Listing 2-14. The aliases for the commands shown in Listings 2-5 and 2-8 through 2-13
[alias]
l
= log --oneline --abbrev-commit --abbrev=4 -25
days = "!days() {
git log --pretty=format:%cd --date=short | uniq;
}; days"
stat = "!stat() {
echo -n Number of revisions:;
git log --oneline | wc -l;
echo -n Number of developers:;
git shortlog -s | wc -l;
echo -n Number of days:;
 
 
Search WWH ::




Custom Search