8 Cool Tips in GitHub Worth Knowing
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!
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
KeyEnter
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.
Sometimes you Specify a line of code and share its location with others, like this:
How to do it?
- Open the project:
- https://github.com/qianlongo/fe-handwriting/blob/master/ 17.quick-sort.js
- 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.
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
- 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.
##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.
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Steps to update git code: Check out code: git clone https://github.com/username/repo.git Get the latest changes: git fetch merge changes: git merge origin/master push changes (optional): git push origin master

To download projects locally via Git, follow these steps: Install Git. Navigate to the project directory. cloning the remote repository using the following command: git clone https://github.com/username/repository-name.git

Git code merge process: Pull the latest changes to avoid conflicts. Switch to the branch you want to merge. Initiate a merge, specifying the branch to merge. Resolve merge conflicts (if any). Staging and commit merge, providing commit message.

Resolve: When Git download speed is slow, you can take the following steps: Check the network connection and try to switch the connection method. Optimize Git configuration: Increase the POST buffer size (git config --global http.postBuffer 524288000), and reduce the low-speed limit (git config --global http.lowSpeedLimit 1000). Use a Git proxy (such as git-proxy or git-lfs-proxy). Try using a different Git client (such as Sourcetree or Github Desktop). Check for fire protection

Git Commit is a command that records file changes to a Git repository to save a snapshot of the current state of the project. How to use it is as follows: Add changes to the temporary storage area Write a concise and informative submission message to save and exit the submission message to complete the submission optionally: Add a signature for the submission Use git log to view the submission content

When developing an e-commerce website, I encountered a difficult problem: How to achieve efficient search functions in large amounts of product data? Traditional database searches are inefficient and have poor user experience. After some research, I discovered the search engine Typesense and solved this problem through its official PHP client typesense/typesense-php, which greatly improved the search performance.

How to update local Git code? Use git fetch to pull the latest changes from the remote repository. Merge remote changes to the local branch using git merge origin/<remote branch name>. Resolve conflicts arising from mergers. Use git commit -m "Merge branch <Remote branch name>" to submit merge changes and apply updates.

To delete a Git repository, follow these steps: Confirm the repository you want to delete. Local deletion of repository: Use the rm -rf command to delete its folder. Remotely delete a warehouse: Navigate to the warehouse settings, find the "Delete Warehouse" option, and confirm the operation.
