Merge pull request #144 from enisozgen/Update-git-cheats

Update-git-cheats
This commit is contained in:
Denis Isidoro 2019-11-04 16:46:23 -03:00 committed by GitHub
commit fa9faf8ac6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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