You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cdpuzzles # change directory into your local repo.
to get to normal workflow of edit, revert, cache, commit, and push to remote.
(edit files)
status of your local changes (optional), e.g. git status
discard your local changes (optional), e.g. git checkout .
put changes to cache (also called index), e.g. git add src/Puzzles.cs
get rid of changes out of cache (optional), e.g. git reset src/puzzles.java
diff —cached before commit, e.g. git diff --cached
commit changes from cache, e.g. git commit -m 'added Puzzles.cs.'
push to remote git repo, e.g. git push [email protected]:0ishi/puzzles.git
pull from remote git repo (optional), e.g. git pull
merge conflicting changes (optional), e.g. git mergetool
to shortcut most common git commands using your favorite shell aliases.
alias gst='git status' # status of changes
alias gco='git checkout' # revert changes
alias gdf='git diff' # changes in the working tree not yet staged for the next commit.
alias gdfcached='git diff --cached' # Changes between the staged index and the last commit.
alias gdfhead='git diff HEAD' # changes in the working tree since the last commit.
alias gad='git add' # into cache
alias gci='git commit' # commit
alias grs='git reset' # out of cache
alias gps='git push' # push
alias gpl='git pull' # pull
alias github='cd /Users/henry/github' # on mac osx
alias puzzles='cd /Users/henry/github/puzzles' # on mac osx
to produce colorful output with git commands.
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto