by Debora Tzunun
- Git is a version control or is where you manage or command codes into another local system.
- Github is a cloud where you store code. Is where you put your command of codes into.
- Git and GitHub are commonly alike from each other because both have to do with coding and connects with each other. Contrastly, git is what code takes place and github is what code is store in
- In order to start git, you'll need to create a new Github account. This website will be the cloud where all your code gets push into
- SSH Key: After that, you'll need to create a SSH key. this will store all the code into Github
- First, in order to do this you'll tneed to click on your profile icon that is located on the right side hand corner of the website page of Github.com.
- When you clicked on your icon then, you should next click on the word "Settings"
- Next, click on "SSH keys" on the left side menu.
- After that, click on "Add SSH key". You'll see that you need a title for your key. Name it of the the website you be connect with github. Whether its Nitrous or Cloud9
- Finally, for this part you'll need copy and paste the key of the website to connect with github (to the website you be adding code). Click on "add key" and BOOM! SSH KEY IS CREATED
- Now that you have your SSH key created, you now need to switch to your Nitrous or Cloud9 and begin to make a new directory. Lets type mkdir first-repo to create you very first.
- Go into first-repo, cd first-repo click enter and type git init , this will active git.
- Lastly, git config --global user.name "First Last" and git config --global user.email "Your Email"
You just now completed the one-time setup of using github!
Now that you're all setup, You're ready to code!
- First of all, of course you will need to initialize git. BUT! first go to the file where you gonna start git. This is important because you may initialize git in the file you DON'T need to. In order to do this you need to make a new file by typing out touch README.md .
- Before adding anything into this file, we need a new repository. So back to your git you need to click on the "+" sign on the top right corner of the github website. click on "new repository" .
- Next, its asking for a repository name. THIS SHOULD MATCH THE NAME OF YOUR FILE FROM YOUR GIT! which in this case id "first-repo"
- Finally, you click "Create Repository" and FINISH! now you are ready to add and commit changes!
As you work through it is always important to check status, add, commit, and push
- First, check your status by typing git status
- Then, add by typing git add .
- Next, commit by typing git commit -m "file name"
- Lastly we push by typing git push -u origin master
This should be the workflow that every user need to memorize in order to add, commit, and push
##Collaboration (Extra Credit)
-
Forking is when you take another remote repository to your remote to enter in into your local machine by cloning.
-
Steps on Forking Someone's Repository
- In Github, choose someone repo you would like to fork. You should see in the upper top corner, underneath your profile icon, the work "Fork". click on it!
- Then, you should copy the SSH clone url and paste it to your local machine ( Nitrous or Cloud9) after your type git clone ( url )
- Finally, your pretty much done, you now got the person's repository copy