Skip to content

velizartodorov/GitCommandsConfigs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitCommandsConfigs

.gitconfig and git commands I use. 😉

.gitconfig 🔧

Open .gitconfig! 😉

If you use Windows, make sure you setup the following section to the corresponding variables:

[user]
	name = %USERNAME%
	email = %EMAIL%
[core]
	excludesFile = %USERNAME%\\.gitignore

Git Commands 🌿

Force push

git push --force origin

Restore deleted branch

gitk --reflog

Force checkout branch, when file conflict appears

git checkout -f another-branch 

Git tree

git log --graph --pretty=oneline --abbrev-commit  

Beautiful Git tree

git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(green)%C(bold)%ad%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --date=short 

Prune tags

git fetch --prune --prune-tags

Delete all merged branches into master and develop

git branch --merged | grep  -v '\\*\\|master\\|develop' | xargs -n 1 -r git branch -d

Cleanup develop branch

git checkout develop | git delete-merged | git remote prune origin | git prune | git prune-tags | git clean -df | git gc

Cleanup master branch

git checkout master | git delete-merged | git remote prune origin | git prune | git prune-tags | git clean -df | git gc

Show current branch

git rev-parse --abbrev-ref HEAD

Rebase on develop

git pull --rebase origin develop

Rebase on master

git pull --rebase origin master

About

.gitconfig and git commands I use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages