Are you a junior developer? Let’s start showcasing your work on GitHub from today!
Why on earth do I need to know how to use GitHub?
Have you ever been in a situation when applying for a developer position and later on being received an email from HR manager saying “Could you give me your GitHub account so that we can check it out?”. Then you suddenly remember that you read about it somewhere and already created an account. However, you left it until now and there is basically nothing in your profile. Well, that’s obviously not a pleasant experience my friend. You just hand over a great opportunity for another guy who does give a damn on what GitHub is.
WTH is GitHub?
According to Wikipedia, GitHub is a Web-based Git version control repository hosting service which provides distributed version control and source code management (SCM).
While sharing and searching for repositories are 2 fundamental features that GitHub offers, there are tons of other benefit as well. I would like to name some of the most useful ones especially for junior developers.
Additional helpful features
1. Documentation: most notably README files featuring Markdown — a light weight markup language. You can either create your own README or let GitHub automatically render it when creating a new repository. README is an imperative part of a repository as it allows developers to document descriptions and instructions for their repositories.
2. Issue tracking: a great way to keep track of tasks, improvements and bugs in your repository. Issues tracking in GitHub is organized in a way that is relatively similar to a thread consisting of title, description, labels, milestone and comments. Its excellent text formatting & friendly UI provide a great collaboration place for team members for debugging and enhancing their projects.
3. Pull request let you tell others about changes you have pushed to a branch of repository. After opening a pull request, you can collaborate with your mates by adding commits, commenting and ultimately merging the pull request when you are satisfied with proposed changes.
4. Commits history keeps record of all your changes in your repository. Commits usually display a commit message in which you can briefly describe what changes you have made. Commits history in a repository normally looks like this:
How to register for a GitHub account
Now that you are somehow aware of GitHub and its main features. You can sign up an account in GitHub homepage. and it is free unless you want to create private repositories.
How to push your local project files to a GitHub repository
- Install Git in your computer
- Open Git Bash at your local folder directory and initiate a new repository on your local project
$ git init
3. Add files & make the first commit
$ git add .
$ git commit -m "your_message"
4. Create a new repository in your GitHub account in your browser
5. Relying on the instruction after creating a new repository, let’s come back to Git Bash to add a new remote repository, which has similar URL with your repository’s address on GitHub
$ git remote add origin url
Finally, you can push your local repository to GitHub’s remote repository
$ git push -u origin master
After that, when refreshing your repository on GitHub, you should be able to see your live repository. Congratulation!
Common issues when creating new repository
- Login credential: when pushing local repository to your remote one, you might be asked for your GitHub login information. All you need to do is filling in and let Git do the rest.
- Pushing errors: happen sometimes when you do not add files to your local repository and make first commit. Remember that after initializing a new repository in your local project folder, you still have to complete these 2 mandatory steps to be able to make a push command.
To sum up, all of these above information & tips probably give you some ideas on how useful GitHub is for us as developers. Nonetheless, you might guess that GitHub offers much more than an environment for people to share repositories. Indeed, there are still a host of benefits that GitHub bring especially for collaboration within a team or organization. However, they are out of this blog’s scope. Therefore, I have put some useful links bellow.
Finally, I strongly believe that by frequently contributing to GitHub, specifically constantly pushing your own repositories as well as spending time developing on others, we are also honing our skillsets and enhancing portfolios. Thanks for reading & happy coding everyone!
- GitHub Basics Course on TreeHouse
- GitHub Crash Course (Traversy Media)
- GitHub Tutorial for Beginners (LearnCode.Academy)
- Understanding the GitHub flow
- About Pull Requests
- Mastering Issues