git
is a version control system that allows you to keep track of all the changes you make to your code, writing and anything text. Instead of saving the current state of your files, git saves the changes you make to files.
Imagine you create a file called “my_file.txt” and later this to your git history.
This change will look like this.
`— /dev/null` means this was created out of nowhere (a new file)
`+++ b/my_file.txt` is the name of your new file
Platforms to host git projects:
Github, Bitbucket, GitLab
Step by step
- Create an account
- Create a repository
- Create a new git repo on your local machine
- git status – to check your status
- Direct your local repo to track a git url (your new repo)
- Commit your changes
- git add <file_name>- to add the files
- git commit – to track a change
- Add your commit message (“yay first commit”)
- Push
Git has a ton of gotchas that can trip up a beginner:
Check out common git gotchas