diff --git a/cheats/git.cheat b/cheats/git.cheat index 8884b786..9b5a1b59 100644 --- a/cheats/git.cheat +++ b/cheats/git.cheat @@ -31,12 +31,14 @@ git checkout git status # Displays unstaged changes for file -git diff / +cd ; \ + git diff -# Stages a changed file -git add / +# Stage single or multiple files +cd ; \ + git add ; -# Stages all changed files +# Stage all files in project git add -A # Saves the changes to a file in a commit @@ -94,12 +96,13 @@ git submodule foreach git pull origin master # Update all submodules git submodule update --init --recursive -# Start ssh agent -eval "$(ssh-agent -s)"; ssh-add - # Skip git hooks git commit --no-verify +# Create new branch from current HEAD +git checkout -b + $ branch: git branch | awk '{print $NF}' $ toplevel_directory: git rev-parse --show-toplevel -$ unstaged_files: git --no-pager diff --name-only +$ unstaged_files: git status --untracked-files=no -s --porcelain | awk '{print $NF}' --- --multi true +$ changed_files: git status --untracked-files=all -s --porcelain | awk '{print $NF}' --- --multi true diff --git a/cheats/ssh.cheat b/cheats/ssh.cheat new file mode 100644 index 00000000..66cb39b3 --- /dev/null +++ b/cheats/ssh.cheat @@ -0,0 +1,4 @@ +% ssh + +# Start ssh agent +eval "$(ssh-agent -s)"; ssh-add