Update-git-cheats

This commit is contained in:
Enis Ozgen 2019-10-30 19:46:30 +01:00
parent 840b96f62d
commit 2eef103c81

View file

@ -30,14 +30,14 @@ git checkout <branch>
# Displays the current status of a git repository
git status
# Displays the changes made to a file
git diff <filename>
# Displays unstaged changes for file
git diff <toplevel_directory>/<unstaged_files>
# Stages a changed file for commit
git add <filename>
# Stages a changed file
git add <toplevel_directory>/<unstaged_files>
# Stages all changed files for commit
git add .
# Stages all changed files
git add -A
# Saves the changes to a file in a commit
git commit -m <message>
@ -95,3 +95,5 @@ git submodule foreach git pull origin master
git submodule update --init --recursive
$ branch: git branch | awk '{print $NF}'
$ toplevel_directory: git rev-parse --show-toplevel
$ unstaged_files: git --no-pager diff --name-only