| Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
VCS is how one tracks changes, modifications, and updates to source files over time. Creating a history of changes for a project over time.
Git is a Free and Open Source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. ( https://git-scm.com )
$ sudo yum install git
$ git config --global user.name "My Name"
$ git config --global user.email "myself@gmail.com"
$ git config --global core.editor "nano"
Create a project with Git:
$ mkdir my-project
$ cd my-project # Always run `git init` inside of a project folder!
$ git init # Never inside of your home directory.
Add and commit a file to your project with Git:
$ touch newfile.txt
$ git add newfile.txt
$ git commit # Edit message in Nano, save the file, exit to commit.
To see which files are staged, unstaged, or untracked:
$ git status
To look through your repository history:
$ git log
To create and checkout a branch:
$ git branch # Shows your branches and current branch
* master
$ git checkout -b <new-branch> # Switches to new branch `<branch name>`
$ git branch
master
* new-branch
$ git checkout master # Switches to existing branch `<branch name>`
Everybody uses VCS differently. Choose the workflow that works best for everybody involved.
$ cd /path/to/my/projects
$ git clone <some git url>
$ cd <new repo directory>
$ ls
$ git clone https://github.com/DevOpsBootcamp/tinsy-flask-app.git
See http://git.io/vcVmB for more details about the tinsy-flask-app repository.
$ cd tiny-flask-app
$ virtualenv venv
$ pip install -r requirements.txt
$ python script.py
Now if you go to <your ip address>:<http port> in your web-browser to see a live version of the app!