Git is a version control system which helps developers track changes to their source code over time. Git also makes it easy for multiple developers to collaborate on a project through the process of committing, branching, and merging.
A "commit" is a snapshot of your codebase at a specific point in time. Git repositories generally consist of many commits, which together provide a complete history of the changes made to your project.
People also often confuse Git with GitHub. Git is a tool, whereas GitHub is an online platform which enhances Git's capabilities by providing remote hosting and other collaborative features.
Git is primarily a command-line tool, but many graphical interfaces (GUIs) are also available for it such as GitHub Desktop. New users may find GUI tools like this to be more intuitive and user-friendly when starting out.
First, the GitHub Docs are an excellent resource for getting started with GitHub.
The following steps describe the basic process of creating a new Git repository on GitHub, cloning it to your computer, making changes, then committing and pushing those changes back to GitHub for others to see.
git add
and git commit
commands (or by using a Git GUI)git push
git fetch
and git merge
, or git pull
which does both.git init
git clone [repository URL]
git add [file]
git commit -m "Your message"
git status
git log
git restore [file]
git reset HEAD~1