Git is a distributed version-control system for tracking changes in any set of files, originally designed for coordinating work among programmers cooperating on source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Install git by visiting https://git-scm.com/downloads and install the appropriate binary for your OS.
git init
to create a new repository in a directorygit add
to track files for changesgit commit
commits those changes permanently in version control historygit push
to push your work to a remote Git hostgit log
to see commit historygit remote
to see what remotes is your repo connected togit branch
to create a new branchgit checkout
to switch to another branch- Tip: use
git checkout -b
to create a new branch and switch to it
- Tip: use
git stash
to remove all local changes in working directory since the last commit
All files and folders you add to the .gitignore file will not be checked into version control.