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
More powerful and detailed change tracking → less conflicts! No server is necessary.
Tipically, the git flow is:
git init- Initialized repository
git add- Adds files and directories to repo
git commit- Commits your changes
git push- Push to your remote repository
There are other commands like:
git checkout ,
git pull and many more!
cookiecutter Project template
cloneit locally, go to the directory (that will host the repository) using the Terminal
Create a project repository on Github and clone it onto your computer
Author -Your name
Project name -2018_Bootcamp_Github_repo
Now you will want to create SSH keys for your Github account
$ cd ~/.ssh $ ssh-keygen -t rsa -b 4096 -C "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
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:
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 firstname.lastname@example.org ## 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.
Back to main website: