Skip to content

Commit ae38e56

Browse files
committed
add: git
1 parent 035cec4 commit ae38e56

3 files changed

Lines changed: 145 additions & 0 deletions

File tree

git/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Automatically normalize line endings for all text-based files
2+
# * text=auto

git/.gitconfig

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
[user]
2+
name = Hemerson Vianna
3+
email = hemerson.lourenco@gmail.com
4+
5+
[alias]
6+
# https://git.wiki.kernel.org/articles/a/l/i/Aliases.html
7+
8+
# General
9+
a = add .
10+
c = commit -m
11+
ca = commit -am
12+
co = checkout
13+
st = status
14+
br = branch
15+
ul = rm --cached
16+
re = rm -r
17+
rt = remote add
18+
rtv = remote -v
19+
rtr = remote rm
20+
ps = push
21+
pl = pull
22+
mg = merge
23+
24+
25+
# Others
26+
psm = push origin master
27+
psum = push -u origin master
28+
pl = pull origin master
29+
ghpage = checkout --orphan gh-pages
30+
type = cat-file -t
31+
dump = cat-file -p
32+
undo = reset --soft HEAD~1
33+
34+
# `git remote prune origin`: remove remote-tracking branches that were deleted from the remote repo
35+
# `git gc`: cleanup unnecessary files and optimize the local repository
36+
# `git clean -df`: remove untracked files and directories from the working tree
37+
# `git stash clear`: remove all stashed states
38+
trim = !git remote prune origin && git gc
39+
cleanup = !git clean -df && git stash clear
40+
41+
# Add untracked, remove deleted, and show status
42+
adda = !git add -A && git status
43+
44+
# Fetch a repository ($1) and checkout its ref ($2) HEAD
45+
browse = !bash -c 'git fetch "$1" "$2" && git checkout FETCH_HEAD' -
46+
47+
# Find out who is currently active on the repository
48+
# Displays committers in descending order of number of commits
49+
who = shortlog --numbered --summary --email --no-merges --since="3 months"
50+
51+
# Sync Forked repository with original
52+
gsync = git fetch upstream && git checkout master && git merge upstream/master
53+
54+
55+
# Diff & Logs
56+
diffc = diff --cached # Diff what is staged for the next commit
57+
diffst = diff --stat # Diff overview
58+
graph = log --pretty=nice --date-order --graph # Custom graph log (append any tree-ish)
59+
grapha = log --pretty=nice --date-order --graph --all # Custom graph log for all branches
60+
logp = log --pretty=nice --date-order # Custom pretty log
61+
logst = log --stat # Diffstat log
62+
logsf = log --stat --format=oneline --abbrev-commit # Short format diffstat log
63+
64+
[color]
65+
# color opts: normal, black, red, green, yellow, blue, magenta, cyan, or white
66+
ui = auto
67+
interactive = auto
68+
69+
[core]
70+
# Use custom `.gitignore` and `.gitattributes`
71+
excludesfile = ~/.gitignore
72+
attributesfile = ~/.gitattributes
73+
editor = subl -W -n
74+
75+
[diff]
76+
tool = mvimdiff
77+
78+
[difftool]
79+
prompt = false
80+
81+
[pretty]
82+
# tut: http://gitimmersion.com/lab_10.html
83+
# ref: http://linux.die.net/man/1/git-log
84+
# Result: <short-sha> <commit-message> (<pointer-names>) -- <commit-author-name>; <relative-time>
85+
nice = "%C(yellow)%h%C(reset) %C(white)%s%C(cyan)%d%C(reset) -- %an; %ar"
86+
87+
[url "git@github.com:"]
88+
insteadOf = "gh:"
89+
pushInsteadOf = "github:"
90+
pushInsteadOf = "git://github.com/"
91+
92+
[url "git://github.com/"]
93+
insteadOf = "github:"
94+
95+
[url "git@gist.github.com:"]
96+
insteadOf = "gst:"
97+
pushInsteadOf = "gist:"
98+
pushInsteadOf = "git://gist.github.com/"
99+
100+
[url "git://gist.github.com/"]
101+
insteadOf = "gist:"

git/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Useful `.gitignore` templates:
2+
# - https://github.com/github/gitignore
3+
4+
5+
# OSX taken from: https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
6+
# ----------------------------------------------------------------------------------------------
7+
._*
8+
.AppleDouble
9+
.DS_Store
10+
.localized
11+
.LSOverride
12+
.Spotlight-V100
13+
.Trashes
14+
Icon
15+
16+
# Windows taken from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
17+
# ----------------------------------------------------------------------------------------------
18+
Desktop.ini
19+
ehthumbs.db
20+
Thumbs.db
21+
22+
# Linux
23+
# ----------------------------------------------------------------------------------------------
24+
*~
25+
26+
27+
# Tags taken from: https://github.com/github/gitignore/blob/master/Global/Tags.gitignore
28+
# ----------------------------------------------------------------------------------------------
29+
# Ignore tags created by etags and ctags
30+
TAGS
31+
tags
32+
33+
# Vim taken from: https://github.com/github/gitignore/blob/master/Global/vim.gitignore
34+
# ----------------------------------------------------------------------------------------------
35+
.*.sw[a-z]
36+
.netrwhist
37+
*.un~
38+
Session.vim
39+
40+
# Sass
41+
# ----------------------------------------------------------------------------------------------
42+
*.sass-cache

0 commit comments

Comments
 (0)