10 practical tips you should take into account to learn how to work with GitHub
Everything, you need to start with GitHub is keep calm and make few easy steps:
1. Download git and create an account
Well, these two things are pretty straightforward to complete. All you need is to install git. Enjoy its awesome graphical user interfaces. First of all, it’s much easier to learn what is the best way to use git-specific commands and after that, you can try a git GUI once you’re familiar with a particular command.
Once it has been successfully done, create your account at GitHub. Just feel in all the lines with data. GitHub has a high-level security, so you don’t need to take care of your privacy. So here’s the answer on one of the important question you might have had: who uses GitHub. As you can see, anyone can join the GitHub society.
2. Make a local git repository
If you’d like to begin with a new project on your desktop or tablet using git, you have to add a new repository (which is also called ‘repo’ for short).
For starters, open up a terminal, then move to the folder on your local machine where you’d like to place your new project while using the change directory command.
3. Add files to the repository
Move forward to filling the project with a new file. You’re able to use any text editor or run a touch command at this step.
Once you’ve finished it, git will warn you about the changes inside the repo waiting to be saved. However, git won’t keep track of the file unless you’ve adjusted it.
Next thing is that you should do a commit. This is a kind of a registry of what files were changed since the last commit. It looks like that: you make changes to your repo and then choose to put them into a commit. Commits save your project at any stage and allow to go back at the very beginning or just at any point despite all further changes.
For adding a file to a commit, add it to the so-called staging environment and after that, you can then use the git commit command to pack them into a commit.
4. Create a commit
So, as you can see, creating of a first commit is a huge progress on your way of how to work with GitHub.
Then just run a special command git commit – “Your message about the commit”. It should include some information about the commit holds – let it be a new feature or any flexible opportunity. Let the other people know about its specific parameters.
5. Establish a new branch
If you want to add a new feature, but have some doubts about whether to make changes to the main project or not, the most convenient solution is to use git branches.
Branches allow you to make steps back and forth between different ‘states’ of a project. When creating a new branch, Git tracks from which commit you just ‘branched’ off, so it keeps the history behind each file.
Now it may seem, that GitHub focuses on needs of a separate developer, however, it is far from being a truth. Next steps will show you, how companies use GitHub.
6. Create a GitHub repo
If you consider an online teamwork, you can use GitHub as a way to modify the code commonly. First, log in and go to the GitHub home page. One simple click on the button “New repository” leads you to the window asking you to enter the name of your new repo and providing a brief description visible for other developers. Here it is, well done. Now you are ready to move forward with a collaboration.
7. Push a branch into GitHub
If you would like to share the changes you’ve made with other people, just push the commit in your branch to a repo. The users approved by the repo’s owner can make merge into the master branch changes then.
8. Produce a Pull Request
Such feature as pull request helps to get know a repo’s owner about your intention to make some changes to their code. So that they will review the code and assure if it looks good enough to be put on the master branch.
9. Merge a GitHub Pull Request
By clicking the green ‘Merge pull request’ button you will merge the changes into the master branch. Now you can check your commits to make double sure and look through the hash code.
10. Get all your GitHub changes back to your computer
After all these manipulations, you will probably need to synchronize the changes in the repo on GitHub and on your local gadget. Now the online version contains the commit and merged into the master branch changes.
Furthermore, the most recent changes merged on GitHub can be got by using a special git pull origin master command to improve your code.
Now hopefully it looks much easier for you, but let’s review, how it is to work with GitHub on real experience.
GitHub for organizations is a great opportunity to be on the same wavelength with their competitors and continually improve their software development skills and expertise.
For instance, the Jelvix team of Android developers shares their progress in software developing. Here is how it looks like:
As you can see, according to 62 commits this project consist of several additional new features for Instagram API, such as
- News Feed
- User Profile
The whole software developing process was absolutely open-mind for all GitHub users. There are some of the improvements, that were made during the workflow:
As you can see, you’re able to manage all the iterations and changes.
Read more about Polymer JS supported by GitHub here.
What is the practical need to show how companies use GitHub? It is a great opportunity to allocate the team all over the world on the project, an easy way to make your code look good and, of course, recruiters can hunt top-rated developers that will join popular open-source projects. As well as for the developer it can be something similar to a portfolio with real experience. On the other hand, code demonstration is a great guide for beginners, who are making their first steps in software development and looking for real cases and smart solutions.
Tracking system forms open statistics, that allow monitoring activity of contributions. It helps to be updated about all changes and provide the project management more effective. Look at the image below to see how to work with GitHub:
Need a qualified team of developers?
Extend your development capacity with the dedicated team of professionals.