📜 ⬆️ ⬇️

For beginners: 5 tips on github

image Alyson La, Data science at GitHub: In October of this year, I celebrated my five-year anniversary of work at GitHub. 5 years ago, I was an accountant who knew nothing about programming, let alone using Git and GitHub.

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

But even working in GitHub, learning Git and GitHub was difficult! Therefore, I want to share 5th tips on using GitHub with other people who are new to programming.
')

Tip # 1: Change the default editor


For many people, a text editor 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 come across merge conflicts (and you meet them, see tip # 4), you will go to VIM to fix the conflict, and you will need to know specific VIM commands for editing the document, otherwise you will want to cry. For more than a year, I had a note on the monitor to remind you of the main VIM commands, such as i (for editing) and: wq (for saving and exit). To avoid pain, you can simply choose a different text editor.

To go to text editors like 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 the subl. or atom. Check out this documentation for setting up access to Atom through a terminal and this documentation for setting up Sublime.

Tip # 2: Use dotfiles


I used Git & GitHub for several years, but I didn't know anything about dotfiles. I am still unhappy that I did not know about it before!

Dotfiles allows you to customize the hints in the terminal so that you can see which git branch you are in and whether you have any uncommitted changes. THIS IS GENIUS! I got dotfiles from an employee ( John Nunemaker ), but if you search for “dotfiles” on GitHub, you will 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 look at pull-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 the address set 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 resolving merge conflicts.


Here I admit that I sometimes lazy. In particular, when it comes to merge conflicts. I can't remember how many times I refused a project or a request pool, because I was faced with 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 through the documentation and a video on YouTube about how to fix merge conflicts. I repeated this exercise several times. Also, you can now fix simple merge conflicts in the GitHub user interface, so this is convenient.

Today, when I encounter a merge conflict, I calmly solve this problem, knowing that thanks to version control I won’t be able to confuse 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 helpful to upload your current project to GitHub to practice Git & GitHub skills.

Create a simple website using HTML, CSS and JavaScript on a tutorial, and then follow the instructions on how to post it on GitHub here , watch the step-by-step video I did some time ago. Or try the super easy method Fork and Go .

Finally, I'm going to share a 6th, perhaps obvious, advice — take a lesson or watch a tutorial on Git & GitHub!

Here are a few of them worth seeing:



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



About GoTo


image

Source: https://habr.com/ru/post/352500/


All Articles