Locked lesson.
About this lesson
Setting up "Git" for version control in our development environment.
Exercise files
Download this lesson’s related exercise files.
Version Control with Git.docx59.9 KB Version Control with Git - Solution.docx
60.4 KB
Quick reference
Version Control with Git
Version control is very important to computer programming, no matter what language or framework you use! It allows you to track changes to your code over time, and back it up in case of emergency.
When to use
Version control is something you'll use every day. Any time you make a significant change to your code, you'll need to version control save it.
Instructions
To set up Git the first time, enter these commands in the git bash terminal:
- git config --global user.name "Your Name"
- git config --global user.email "you@youraddress.com"
- git config --global push.default matching
- git config --global alias.co checkout
- git init
Be sure to use the same email address that you plan to use later on at github.com
Sign up for an account on github.com.
To Save your code and commit your changes, use these two commands in the git bash terminal
- git add .
- git commit -am "Commit Message Here"
Version control is a great way to back up code, but it also helps several developers to work on code in groups and merge their code together in the future.
Hints & tips
- Git is the type of version control we'll use.
- After we save our file with git, we'll push it to github.com for safe keeping.
Lesson notes are only available for subscribers.