Git Cheat Sheet: by Thesyntacticsugar
Git Cheat Sheet: by Thesyntacticsugar
By thesyntacticsugar
INSTALLATIONS:
Git for All Platforms https://windows.github.com
GIT CONFIGURATION:
The command returns a list of information
git config -l about your git configuration including user
name and email
git config --global With the command you can configure your user
user.name "Rupam" name
git config --global This command lets you setup the user email
user.email "[mail]" address you'll use in your commits.
UNDO CHANGES:
Create new commit that undoes all of the
git revert
changes made in , then apply it to the current
<commit> branch.
git branch
Create and check out a new branch named
[branch-name]
git branch -d When you are done working with a branch and
branch_name have merged it, you can delete it
REMOTE REPOSITORIES
Create a new connection to a remote repo.
git remote add
After adding a remote, you can use as a
[alias] [url] shortcut for in other commands.
git log --follow show the commits that changed file, even
[file] across renames
ADVANCED DIFF
Show difference between working directory and
git diff HEAD last commit.
REWRITE HISTORY
Show difference between working directory and
git reset last commit.
git reset --hard Clear staging area, rewrite working tree from
[commit] specified commit