9. Github usage - Wiebsonice/GalleryMatch GitHub Wiki
GitHub is a platform which works with the Git system. Is a platform which is optimised for working in groups. Is basically an interface for the usage of the Git system.
GitHub is how people build software We’re supporting a community where more than 36 million* people learn, share, and work together to build software.
Index
What is git?
Git is originally created by Linus Torvalds in 2005. Git is wildly used for by millions of developers word wide, it's an easy way of doing version control, maintaining and updating code. Git itself can be quite technical thus a lot of Git repository management solutions where made for a better and more understandable UI. Well known solutions are:
By far, the most widely used modern version control system in the world today is Git. Git is a mature, actively maintained open source project. A staggering number of software projects rely on Git for version control, including commercial projects as well as open source. Developers who have worked with Git are well represented in the pool of available software development talent and it works well on a wide range of operating systems and IDEs (Integrated Development Environments). - Athlassian
Github it is
One of the requirements of the course was to work with Github. To get used to the Git system and Getting used to documenting your builds for the world to understand. To have a quick understanding of what Github has to offer i'm going to give more info about some of the beloved Github functions.
Repository overview
This is the overview of your repository, All the files from the root folder can be found here. If the repository contains a Readme.md
file, it will be displayed below the files. The readme file usually contains info about the repository, the licence and the installation or usage guide.
Issues
If you're collaborating with others, the issue
section is quite useful. If you encounter bugs while using the code from the repository, you can make the creator known of the bug in the issue page. It's also a place where you can request or keep track of desirable features for upcoming updates.
Projects
The projects section is quite similar to a planning board like Trello. It's a digital and online post-it board, where you can place all the issues, assign them to a user and place them in a status section such as Open
, Doing
& Done
.
The Wiki
Last but not least, the mighty wiki function. The wiki function is where you can document everything you've did on the repository, you can explain choices, show done research and many more. Obviously you know how to read the wiki because this page is on my wiki. Every page on the wiki is written in Markdown
. For more information about Markdown check this link for a cheat sheet
How do I use Git?
How do you keep track of your code and updates? How do you update everything and what is pulling, what is pushing?
Pull
Pull is a function to get the latest files from the .git server, and save them on your local device. If you're working on your own it's not a function you'd use often unless you're working on multiple devices.
However if you're collaborating with others you'll be using this function a lot. To get the latest files to your local machine.
Push
Pushing is the most used function of git, its basically like saving your files, but to the cloud. Usually after finishing a function you'd push it so that it's up to date with the files in the cloud.
Branches
For this project I haven't used branches, but branches are quite useful on bigger projects, and when working with multiple collaborators. You can see branches like train tracks, from default you're working on the master
branch. The master
branch is the main train track. If you make a branch it's a copy of the master
train track, but placed on a different track (branch).
This train is totally different to the master
until you add the coupe's to the master train. This can be done when merging your other branch to the master
branch. Thus making the 2 branches (trains) in to the merged master
branch (train).
Usually branches are made when building features, after a feature is done, the made branch is then deleted after finalising the feature.
Git in use
Github Desktop client
The Github Desktop Client is an easy solution for the tracking of your git status. Due to it being made by Github, you need a Github account. It might not be the quickest way of using git, but it is a good solution for starters to git.
Atom Github integration
For the people who use Atom, there is an easy way of doing this, the magic of the GitHub integration. It's quite similar to the Github desktop client, but the convenient thing is the fact that its integrated in your editor, next to your code.
Git CLI
The most advanced and technical way of pushing and pulling your files to the git server are done with the terminal. To give a quick rundown on how to push or pull your repo i made the below tutorial.
1. Navigate to your repo folder on your local machine.
2. Pull the latest files from the git cloud
Pull the latest files from the cloud.
$ Git pull
3. Pull the latest files from the git cloud
Check if there are any changes to the local files
$ Git status
4. Add untracked files
Stage all files which are changed
$ Git add .
5. Commit staged files
Commit all staged files, basically make them ready to send to the online repo.
$ Git commit -m ‘Commit message here’
6. Push your files to your online repo
Send your new updated code in to the world
$ Git push
My verdict
For this project i've tried to get used to the Git CLI but after some coding I stepped back to the Atom way. Because atom was something i was used to, I found it easy to have the git interface within my browser so i could actually see the changes, and made a quick commit and push.
The way of getting my commits in check was after every feature (and after testing it of course) i'd commit and push the changes. So if i happen to break it after some new changes i, could always go back to the latest working commit.
But! In the future ill try and get used to the Git CLI when working with Github, to get more familiar to the terminal and al its powers.
More info about git can be found here.