DEV Community

Kauress
Kauress

Posted on

Easy Peasy Git for Github with clix

Original Question asked by student

Is there a way to show that folder structure in git? I'm struggling to visualize how it looks in git and how we would push that structure to git. Are there instructions for how to create the structure on our computers then push it to git?

Answer

Git is a version control tool. For example when you write an essay you have many versions on your desktop, for example 5 versions. You might decide that essay #1-3 are no good and put them in a folder called "rough_draft" and put essay #4 and #5 in a folder called "final_edit".
In this case you are versioning/controlling what versions you want manually.

However, when you code and have many sub-folders within a main folder and multiple files, it is not possible to manually control what versions you want. Unless you copy paste the project folder and it's contents each time that you make a change. Which is tedious and impracticable when working with teams.

Therefore, using a version control tool like git is a good choice. Git provides you with a workflow to code without worrying about if the latest version of your code has been saved. Git only stores a snapshot of your current changes , it's like a camera that will take a picture when clicked of any changes that you make in any file in whatever folder they may be.

So git does not organize your files or folders. That you will have to do manually. Git will only take "snapshots" of changes of your files. If you move files around into different folders, it does not matter.

Github is an online platform where people can upload their code. This is called pushing. It's like saving pictures in an album and then uploading the album to facebook.

To do this the easy way:

  1. Make an account on github.com
  2. Make a repository

Alt Text

  1. Name your repository and "click on create repository"

Alt Text

  1. Click on "uploading on existing file"

Alt Text

  1. Now you can either drag or drop your files into the middle area or click on "Choose files" AND then click on the green "Commit changes" button

Alt Text

  1. Alt Text

  2. You will be redirected to your repository OR project folder on github if you may, where you will now see your file uploaded on github.com in your repository

Alt Text

Git workflow on the terminal

Alt Text

Discussion (0)