-
Notifications
You must be signed in to change notification settings - Fork 12
Chapter 6: GIT Version Control System
Saranga Wijeratne edited this page Aug 22, 2018
·
20 revisions
System that records changes to a file or set of files over time so that you can recall specific version later
https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
- Version control important when collaborating with others
- Stream of snapshots
https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
- Created by the same people who developed Linux
- Can operate through the terminal
- Download the
GIT
from the following link for your operating system.
- Follow the on-screen instruction to get the
GIT
onto your system
git config --global user.name "Your git username"
git config --global user.email "your email"
- Only need to do this once
- Check the configuration
$ git config --list
GitHub
is a web-based hosting service for version control using git
- Set up a
GitHub
account - Navigating
GitHub
-
GitHub
profile personalizing
-
Git
Local and on your computer -
GitHub
Remote
Important: You don't need GitHub
to use Git
but GitHub
allows you to share and collaborate with other users. Also, gives your local repository a backup.
- Start a repository from scratch
- "Fork" another user's repository/repo
- Provide a name for your repo
- A brief description to your repo
- Select the box next to "Initialize this repository with a README"
- Add a license if needed
- Hit the "Create repository"
Make a directory for your new repo
mkdir test-hcs
# Navigate into the folder you just created
cd test-hcs
Initialize a local Git
repo
git init
Point out your local directory to remote directory.
git remote add origin https://github.com/HCS7194-AU18/test-hcs.git
Get content of the remote repo to working_dir
git pull origin master
Edit your README.md
file
Add the changes to the local repo
# Add all new files
git add .
git commit -m "My first edit"
Note:
This only updates the local
repo but not the remote
repo
git push origin master
-
fork
a repo -
clone
a repo