Author: When Knight
https://www.cnblogs.com/iamzhanglei/p/6177961.html
1. Turn the Github project into a front-end website in one second
Everyone may know GitHub Pages. The common practice is to establish a branch of gh-pages. The GitHub Pages module in the setting can automatically create the project's website.
The pain point often encountered here is that when the master encounters a change, it often needs to sync to gh-pages, especially the pure web front-end project. This pain point is very painful.
The official Github may have sensed the pain point, and a master as a website is an option, which is very useful.
After selecting the master branch, the master automatically becomes a website. All master submissions will be automatically updated to the website.
2. Accurately share key codes
For example, if you have a line of code in a file that is very cool or critical, you want to share it.
Can be added after the url#L行号
For example, click the following url:
https://github.com/AlloyTeam/AlloyTouch/blob/master/alloy_touch.js#L240
You will jump to line 240 of alloy_touch.js.
So the question is coming? What if I want to share multiple lines of code? It is also very simple: add the
#L
start line number and -L
end line number after the url
For example, AlloyTouch's motion easing and inverse easing functions are shown in the following code segment:
https://github.com/AlloyTeam/AlloyTouch/blob/master/alloy_touch.js#L39-L45
In fact, you don't need to remember that you operate directly behind the URL, github will automatically generate the URL for you. For example, if you click on line 39, the url becomes
https://github.com/AlloyTeam/AlloyTouch/blob/master/alloy_touch.js#L39
Then hold shift and click on line 45, the url becomes
https://github.com/AlloyTeam/AlloyTouch/blob/master/alloy_touch.js#L39-L45
Then you can copy and share this url. The person who clicks on this url will automatically jump to line 39 and highlight lines 39-45.
3. Automatically close issues by submitting msg
For example, someone submitted an issue https://github.com/AlloyTeam/AlloyTouch/issues/6
and then you go to the trunk to change the code. When you submit the msg after the change, fill in:
fix https://github.com/AlloyTeam/AlloyTouch/issues/6
This issue will be closed automatically. Of course, not just the keyword fix. The following keywords are also acceptable:
-
close
-
closes
-
closed
-
fixes
-
fixed
-
resolve
-
resolves
-
resolved
4. Embed Github via HTML
As shown below, the user and repo can be changed to what you want to display
<iframe src="//ghbtns.com/github-btn.html?
user=alloyteam&repo=alloytouch&type=watch&count=true"
allowtransparency="true"
frameborder="0" scrolling="0"
width="110" height="20">
</iframe>
After inserting, you can see this display:
5. gitattributes set the project language
As shown in the figure above, github will automatically identify whether your project is an HTML project or a Javascript project based on the number of related file codes.
This poses a problem, such as AlloyTouch was initially recognized as an HTML project.
Because there are more HTML examples than JS files. How to do it? gitattributes to help you get it. Add the following .gitattributes file in the root directory of the project
https://github.com/AlloyTeam/AlloyTouch/blob/master/.gitattributes
inside:
*.html linguist-language=JavaScript
The main meaning is to identify all the suffix codes of html files as js files.
6. View the access data of your own project
Under your own project, click Graphs, and then click Traffic as shown below:
It contains detailed data and rankings of Referral sites and Popular content. Such as: Referring sites
Referring sites on behalf of everyone from what site you came to your project, Popular content on behalf of people often see which files of your project.
7. Trending leaderboard
The above teaches you to set the language. Below you can see how to view the daily leaderboard of a certain language. For example, js daily leaderboard:
https://github.com/trending/javascript?since=daily
https://github.com/trending/html?since=daily
https://github.com/trending/css?since=daily
Github recommended: https: //github.com/explore
8. Others
-
Enter colon in issue: add emoticons
-
Any interface, shift +? Show shortcut keys
-
Selected text in issue, R key quick quote
At last
Well, I will have so many, which is the technique I often use. Welcome to add practical skills, I will keep updating ...
I recommend going to my blog to read more:
1. Java JVM, collection, multithreading, new features series tutorials
2. Spring MVC, Spring Boot, Spring Cloud series of tutorials
3. Maven, Git, Eclipse, Intellij IDEA series of tool tutorials
4. The latest interview questions for Java, backend, architecture, Alibaba and other major manufacturers
Life is beautiful, see you tomorrow ~