git

git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Install git

brew install git

Upgrade git

brew upgrade git

Install git-extras

brew install git-extras

Upgrade git-extras

brew upgrade git-extras

Check Current Version of git

git -v

Clone a Git Repository

git clone https://github.com/geofffilippi/first-contributions.git

Show Remotes

git remote -v

Add an Upstream Remote

git remote add upstream git@github.com:littlesticks/astro-template-foundation.git

Show Branches

git branch -a

Create a New Branch

git checkout -b 1-fix-json5

See Changed Files

git status

View Differences Between Current Code and Last Commit

git diff

Add All Changes

git add .

View Commit History

git log

Commit Changes

git commit -m "fixes littlesticks#1 json5 prototype pollution via parse method"

Push Code to Server

git push

Push the Current Branch and Set the Remote as Upstream

git push --set-upstream origin 1-fix-json5

Revert Uncommitted Changes in a Branch

git reset –hard

Revert Ignored Changes in a Branch

git clean -fxd