reading-notes

Class 03: Revisions and the Cloud

Using Git, GitHub, the Terminal & VScode



What is Git? How does it relate to GitHub?

Git allows sharing of code and collaborations with other people. Git is the version control and GitHub is the online code storage.

Attributes of Git

Version Control

What is GitHub?

What is a repository? (repo)



Creating a Repository on GitHub

- Create a new repo
- Name it
- Give a description
- Check that it’s public
- Add a README file
- Change the branch from none to main (under Pages/build&deployment)
- Then hit save. Your site is now live

Linking Your Repo to Your Computer

  1. Copy the repo address from your GitHub repo page under the ‘htpps’ heading. You can find this under the tab/dropdown for ‘<> Code’ on your main code page for your repo.

  2. Then you will use Git Clone to link your repo in the terminal:

  3. Navigate within the terminal to the correct project storage file, i.e. ‘code-102.’

  4. Type: ‘git clone (paste your link from github w/o brackets)’

  5. Run the command (in code-102) ‘ls’ then ‘cd hello-world’

  6. You should now see ➜ hello-world git:(main) if you did it correctly

It will look like this if you did it correctly:


Cloning into 'hello-world'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.



Git Commands and More

GITFLOW: ACP- (ADD, COMMIT, PUSH)



How to ACP your files from Git:

1. 'git add' (your file to save)
2. 'git commit -m “with a message in quotes”'
3. 'git push origin main' (to push the changes up to github cloud)
4. 'git status' (Be sure to use  in between each stage to check for problems).


Files in Git can reside in three main states: committed, modified and staged.

The Life Cycle of File Status

  1. After you edit a file, Git flags it as modified because of changes made after the previous commit.
  2. You stage the modified file.
  3. Then, you commit staged changes.

Notes gathered from Udemy site and class 03 video Read Git Intro



Answer