For Beginners: 5 GitHub Tips

Original author: Alyson La
  • Transfer
imageAlyson La, Data science on GitHub: In October of this year, I celebrated my 5th anniversary on GitHub. 5 years ago, I was an accountant who knew nothing about programming, not to mention the use of Git and GitHub.

Now I'm a Data Scientist enthusiast who knows some things about writing code with Git & GitHub. Thanks in part to the study of these technologies, I made this career transition.

But even while working on GitHub, learning Git and GitHub was hard! Therefore, I want to share 5 tips on using GitHub with other people who are new to programming.

Tip # 1: Change the default editor


For many people, a text editor when using Git through a terminal is VIM. VIM can be terrible, scary for a new or casual hacker. Or even for veteran hackers like @haacked .

image

If you ever encounter merge conflicts (and you meet them, see tip # 4), you will end up in VIM to fix the conflict, and you will need to know the specific VIM commands to edit the document, otherwise you will want to cry. For more than a year I had a note on the monitor to remind the main VIM commands, such as i (for editing) and: wq (for saving and exiting). To avoid pain, you can simply select a different text editor.

To switch to text editors such as Atom, Sublime, or TextMate, follow the instructions in this help .

While you are in it, you must be sure that the hotkeys are configured and you can open the desired text editor through the terminal using subl. or atom. View this documentationto configure access to Atom through the terminal and this documentation to configure Sublime.

Tip # 2: Use dotfiles


I used Git & GitHub for several years, but did not know anything about dotfiles. I am still unhappy that I did not find out about this before!

Dotfiles allows you to set up tooltips in the terminal so that you can see which git branch you are in, and whether you have uncommitted changes. THIS IS GENIUS! I got dotfiles from an employee ( John Nunemaker ), but if you search for “dotfiles” on GitHub, you'll find many options.

image

Tip # 3: Install Hub


Hub is a command line tool that simplifies the use of GitHub. I often work in the repository through the terminal, and sometimes I need to see pool requests and problems on GitHub. To do this, I need to open a tab in the browser, and then I get distracted by email / twitter / puppy - and ten minutes later I move on to typing the address of the GitHub repository.

The hub browse command entered in the terminal will automatically open the repository URL directly in your browser.

image

Tip # 4: Practice Merge Conflict Resolution


Here I admit that I am sometimes lazy. In particular, when it comes to merger conflicts. I can’t remember how many times I refused a project or a request pool because I was facing a merge conflict.

They scared me, the documentation on how to fix them scared me, and then I went to VIM and wanted to leave forever (see tip # 1).

Then I realized that I needed to face my fear, so I created a repository for practice, created a merge conflict, looked at the documentation and YouTube video on how to fix merge conflicts. I repeated this exercise several times. Also now you can fix simple merge conflicts in the GitHub user interface, so it was convenient.

Today, when I encounter a merge conflict, I calmly solve this problem, knowing that due to version control I will not be able to mix up too much.





image

Tip # 5: Create a GitHub Page


GitHub Pages is a free website hosting service from GitHub, for projects or personal use. It will always be useful to upload your current project to GitHub to practice your Git & GitHub skills.

Build a simple website using HTML, CSS, and JavaScript tutorial, and then follow the instructions for posting it on GitHub here , watch the step-by-step video I made a while ago. Or try the super easy Fork and Go method .

Finally, I'm going to share the 6th, perhaps obvious piece of advice - go through the lesson or watch the Git & GitHub tutorial!

Here are a few that are worth a look:



I hope this list of tips has been helpful, and if you have any other tips that have become useful in your study of Git and GitHub, it would be great to hear them!



About GoTo School


image

Also popular now: