A version control is mostly based around one concept:
Tracking changes that happen within directories or files
In most cases
As you work with your files that are under version control, each change is tracked automatically!
After each of these changes, you need to commit your changes
As members of your team commit changes, it is important that you have the latest version → Reduces chance of conflict
You would need to do a git pull
to update.
Since each commit is recorded as a change of a file or set of files, it is sometimes useful to view what changed between revisions.
Most versions controls let you compare two files to see which lines of code changed!
If you want experiment with code that could break your repository, you could create a branch.
It works in a client-server relationship. It's easy to understand and your have more control over users and access
http://guides.beanstalkapp.com/version-control/intro-to-version-control.html
More powerful and detailed change tracking → less conflicts! No server is necessary.
http://guides.beanstalkapp.com/version-control/intro-to-version-control.html
Tipically, the git flow is:
git init
- Initialized repository git add
- Adds files and directories to repogit commit
- Commits your changesgit push
- Push to your remote repository
There are other commands like: git clone
, git merge
, git status
, git branch
, git checkout
, git pull
and many more!
cookiecutter Project template
clone
it locally, go to the directory (that will host the repository) using the TerminalCreate a project repository on Github and clone it onto your computer
Author -
Your nameLicense -
MITProject name -
2018_Bootcamp_Github_repoNow you will want to create SSH keys for your Github account
$ cd ~/.ssh
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
$ Generating public/private rsa key pair.
Enter file in which to save the key (/Users/calder/.ssh/id_rsa): github_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
$ ls
github_key
github_key.pub
$ chmod 600 github_key*
$ mv github_key ssh_keys/
$ mv github_key.pub pub_keys
~/.ssh/config
open ~/.ssh/config
and add this to the file
## Connects to Github
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/ssh_keys/github_key
IdentitiesOnly yes
PreferredAuthentications publickey
Follow the instructions on:
https://help.github.com/articles/connecting-to-github-with-ssh/
ls -al ~/.ssh
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/ssh_keys/* # or ssh-add -K ~/.ssh/id_rsa if in Mac
And now test your connection
# Attempts to ssh to GitHub
ssh -T git@github.com
## You should see something like this
The authenticity of host 'github.com (IP ADDRESS)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
## You should see this
Hi username! You've successfully authenticated, but GitHub does not
provide shell access.
git
and Github
!!Back to main website: