You have to collect the GitHub tips

Source: Internet
Author: User

Turn the GitHub project into a front-end site in a second

GitHub pages as you may all know, the common practice is to build a gh-pages branch through the GitHub pages module in setting to automatically create the project's website. The pain point that is often encountered here is that master encounters changes, often need to go to sync to gh-pages, especially the pure web front-end project, this pain point is very painful. GitHub officials may smell the pain point, out of a master as the site is an option, too useful.

When you finish selecting Master Branch, Master automatically becomes the website. All submissions from Master are automatically updated to the site.

Share key codes with precision

For example, you have a file where a line of code is very cool or key, want to share. You can add #L行号after the URL, for example, click the following url:https://github.com/alloyteam/alloytouch/blob/master/alloy_touch.js#l240 You will jump to the No. 240 line of alloy_touch.js.

So that's the problem? What if I'm a piece of code that multiple lines of code want to share? Also simple: Add #L开始行号-L End line number after the URL for example, Alloytouch's motion easing and inverse easing functions are shown in the following code snippet: https://github.com/AlloyTeam/AlloyTouch/ Blob/master/alloy_touch.js#l39-l45

In fact, you do not have to remember that you directly behind the URL, GitHub will automatically help you generate the URL. For example, if you click on line 39, the URL becomes https://github.com/AlloyTeam/AlloyTouch/blob/master/alloy_touch.js#L39 and then shift-click 45 lines, the URL becomes HTTPS ://github.com/alloyteam/alloytouch/blob/master/alloy_touch.js#l39-l45 then you can copy and share the URL, click the URL of the person will automatically jump to 39 lines, And 39-45 lines are highlighted.

Automatic shutdown of issues by committed MSG

For example, someone submitted a issues HTTPS://GITHUB.COM/ALLOYTEAM/ALLOYTOUCH/ISSUES/6 and then you go to the trunk to change the code, after the completion of the submission of MSG, fill in:

fix  https://github.com/AlloyTeam/AlloyTouch/issues/6

This issues will be automatically closed. Of course not just fix this keyword. The following keywords are also available:

    • Close
    • Closes
    • Closed
    • Fixes
    • Fixed
    • Resolve
    • Resolves
    • Resolved
Embed GitHub in HTML

As shown below, the user and repo are changed to what you want to show.

 <iframe src = "//ghbtns.com/github-btn.html?user=alloyteam& Repo=alloytouch&type=watch&count=true "Allowtransparency=" true "Frameborder=" 0 "Scrolling= "0" Width=" Height= "> </IFRAME>             

After inserting, you can see a display like this:

Gitattributes Setting the project language

As shown, GitHub automatically identifies you as an HTML or JavaScript project based on the number of related file codes. This poses a problem, for example, that Alloytouch was initially identified as an HTML project. Because the HTML example is more than the JS file. What do we do? Gitattributes to help you get it done. At the root of the project, add the following. gitattributes file can be, https://github.com/AlloyTeam/AlloyTouch/blob/master/.gitattributes inside:

*.html linguist-language=JavaScript

The main meaning is to identify all the HTML file suffix code as a JS file.

View Access data for your project

Under your own project, click Graphs, and then click Traffic as follows:

There are detailed data and rankings for referring sites and popular content. such as: referring sites

where referring sites on behalf of everyone from what website came to your project, Popular content on behalf of everyone often look at your project which documents.

Trending leaderboard

The above teaches you to set the language, below you can see how to view the daily leaderboard of a certain type of language. such as the JS daily leaderboard:

Https://github.com/trending/javascript?since=daily

Https://github.com/trending/html?since=daily

Https://github.com/trending/css?since=daily

Other
    • Enter Colon in issue: add expression
    • Any interface, SHIFT +? Show shortcut keys
    • Issue selected text, R key Quick reference
    • This article reproduced!!!!!!!

You have to collect the GitHub tips

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.