Home > Development Tools > git > 8 Cool Tips in GitHub Worth Knowing

8 Cool Tips in GitHub Worth Knowing

青灯夜游
Release: 2022-06-14 10:40:21
forward
2561 people have browsed it

As a developer, most of me have used GitHub. But you may not know that GitHub has many hidden features that can help us use it better. The following article will share with you 8 cool GitHub skills to make you look like a boss!

8 Cool Tips in GitHub Worth Knowing

1. Use the "t" key to quickly search for files

This is a cool feature that only a few people know about . When you want to view the contents of a file, you can press the "T" key and then enter the file name to jump directly to the target file.

Steps

  • Open https://github.com/lodash/lodash

  • Press T Key

  • Enter add.test.js (any file name you want to search for).

  • Click to jump to view the file content

2. Use online 3 ways to view code in the "VSCode" editor

Although using the "T" key allows us to quickly search files, it becomes inefficient when you want to view the entire project code.

Here are three ways to view the code online, just like in the VSCode editor. The third way is my favorite way and I think you will like it.

 2.1. Method 1: Use the "." shortcut key

  • to open the project https://github.com /vuejs/vue

  • Click the '.' key on the keyboard

  • Then the page will be redirected to https://github.dev/vuejs /vue

#2.2. Method 2: Use "github1s.com"

When you see a project you like on GitHub, you need to change "github" to "github1s" to achieve the same effect as method 1!

  • Open the project https://github.com/vuejs/vue

  • Change https://github.com/vuejs/vue to https://github1s.com /vuejs/vue

##2.3. Method 3: Use "gitpod.com/#xxx "The third way is amazing. You can even run Node.js code directly online. I like it so much. It's very easy to use, you just need to prepend your GitHub link with gitpod.com/#.

    Open the project https://github.com/qianlongo/fe-handwriting
  • at https://github.com/qianlongo/ Join gitpod.com/# before fe-handwriting.

3. Share the specified line of code with others

Sometimes you Specify a line of code and share its location with others, like this:

8 Cool Tips in GitHub Worth KnowingHow to do it?

Steps:

    Open the project:
  • https://github.com/qianlongo/fe-handwriting/blob/master/ 17.quick-sort.js


  • Click the line number on the left
  • Copy link (https://github.com/qianlongo/fe -handwriting/blob/master/17.quick-sort.js#L8)

I believe you must have noticed Our link has "L8" after it. Yes, that's right, you can link to the code you want by changing the "L" line number.

4. Share specified multiple lines of code with others

Since we can link to a single line of code, we can link to multiple lines of code.

Steps:

    Open the project:
  • https://github.com/qianlongo/fe-handwriting/blob/master/17.quick-sort. js


  • Hold down the "shift" key and click on the line number on the left.
  • Copy link(https://github.com/qianlongo/fe-handwriting/blob/master/17.quick-sort.js#L8-L24)

5. Jump to the function definition

How to quickly link to the defined function The place? I recommend you a chrome plug-in called sourcegraph.
After the plug-in is installed, a button will appear when the mouse is placed where the function is used. Click to link to where it is defined.

8 Cool Tips in GitHub Worth Knowing

##6. View the shortcut key list

GitHub provides a lot of shortcut keys to help us read the code, but remembering them is not an easy thing. Fortunately, you can use

"Shift " "" to bring up the shortcut keys list.

8 Cool Tips in GitHub Worth Knowing

For more programming-related knowledge, please visit:

Introduction to Programming! !

The above is the detailed content of 8 Cool Tips in GitHub Worth Knowing. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template