By working on my MIT assignment, I clearly saw that there needs to be some way one should be able to see little by little what are the improvements one has made to a program.
If you are working on one file… then once you improve the program and you save it, you lose the previous version! And this can be quite annoying actually.
It is then that GitHub came to my mind. I don’t really know how to use it, but basically I know it’s a place where people put code, and you can see different versions etc. and it seems to be used quite extensively in professional coding, so I have decided to learn how to use it.
Learning how to use GitHub
To learn how to use GitHub, this video is the one that really helped me understand.
Basically I can see it is quite a rigurous program, that forces the user to pretty much document every change before it can be put up to the cloud. Then there are great tools in the cloud to see all the previous versions of the file etc!
To use GitHub I had to use the command line, which can always be a bit scary.
For windows I downloaded the program and then downloaded the Git Shell.
Creating a project.
Then there are some very basic comands really! After you have created your repository online on your GitHub account, you then just need to go to whatever folder in your computer you want to save your “repository” or project on, and type:
- git clone <URL of the repository>
This will basically pass the project to your computer.
Uploading the changed files of a project.
Then, from the GitShell (and while you are inside of your project folder), there is a process to upload a file you changed online again.
First you can type:
- git status
This will show you the status of the files on that project… have they been modified, but not uploaded yet? etc.
Then you can type the command below if you want to upload one specific file or all the files of that project.
- git add <filename>
- git add -A
The file won’t be yet uploaded though! For it to be uploaded it first needs to be commited. This forces the user to put a coment on what are the changes made etc. You do this by:
- git commit -m <“instert your comment here”>
Then, file won’t yet really be up! For it to be up you need to push it by using:
- git push
And there you go! Your file will be up online, and all the changes and previous versions or versions from other people will still be accessible and all.
If you want to then update your files on your pc with the latest changes on the GitHub online, then you need to use:
- git pull