Introduction to Git
What is Git?
Section titled “What is Git?”Git is a distributed version control system.
It allows you to track file history, collaborate with others, and roll back to a previous state in case of error.
➡ Unlike a simple backup, Git records each modification with a commit.
Git vs GitHub
Section titled “Git vs GitHub”- Git = the tool installed locally, used to manage your repositories.
- GitHub/GitLab/Bitbucket = online platforms to host and collaborate on repositories.
Quick example
Section titled “Quick example”git init # create a Git repositorygit add . # add all filesgit commit -m "Init" # commit the files
Best practices
Section titled “Best practices”- Always write clear commit messages.
- Don’t confuse Git (tool) with GitHub (platform).
- Remember to use
.gitignore
to exclude unnecessary files.