From 442b6d0eccac0df8cbc4bcea2007c4e0819d1fb6 Mon Sep 17 00:00:00 2001 From: Richard Davis Date: Sat, 21 Sep 2019 12:17:47 -0500 Subject: [PATCH] Added additional cheats for git --- cheats/git.cheat | 56 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/cheats/git.cheat b/cheats/git.cheat index 45226dde..cf422421 100644 --- a/cheats/git.cheat +++ b/cheats/git.cheat @@ -1,13 +1,61 @@ % git -# Clear everything -git clean -dxf +# Set global git user name +git config --global user.name "" -# Sign all commits in a branch based on master -git rebase master -S -f +# Set global git user email +git config --global user.email "" + +# Initializes a git repository +git init + +# Adds a remote for a git repository +git remote add # Checkout to branch # Change branch git checkout $ branch: git branch --format='%(refname:short)' + +# Displays the current status of a git repository +git status + +# Displays the changes made to a file +git diff + +# Stages a changed file for commit +git add + +# Stages all changed files for commit +git add . + +# Saves the changes to a file in a commit +git commit -m "" + +# Pushes committed changes to remote repository +git push -u + +# Pushes changes to a remote repository overwriting another branch +git push : + +# Overwrites remote branch with local branch changes +git push -f + +# Pulls changes to a remote repo to the local repo +git pull --ff-only + +# Merges changes on one branch into current branch +git merge + +# Displays log of commits for a repo +git log + +# Displays formatted log of commits for a repo +git log --all --decorate --oneline --graph + +# Clear everything +git clean -dxf + +# Sign all commits in a branch based on master +git rebase master -S -f