Author: as knight www.cnblogs.com/iamzhanglei…

1. Turn the Github project into a front-end site in a second

GitHub Pages can automatically create the website of the project through the GitHub Pages module set in the setting.

A common pain point here is that the master often needs to sync to GH-Pages when it encounters changes, especially for pure Web front-end projects.

Github officials may have sensed the pain point and created a master site as an option, which is very useful.

After you select Master Branch, the master automatically becomes a website. Master all referrals automatically updated to the site.

2. Share key codes accurately

Say you have a line of code in a file that is really cool or key and you want to share it.

The URL can be followed by a #L line number

For example, click on the following URL:

Github.com/AlloyTeam/A…

You jump to line 240 of alloy_touch.js.

So the question is, right? What if I’m one piece of code, multiple lines of code that I want to share? It’s also very simple: follow the URL with #L starting line number -l ending line number

For example, the motion easing and reverse easing functions of AlloyTouch are shown in the following code snippet:

Github.com/AlloyTeam/A…

Github will automatically generate the URL for you. Let’s say you click on line 39 and the URL becomes

Github.com/AlloyTeam/A…

Hold shift and click on line 45, and the URL becomes

Github.com/AlloyTeam/A…

Your URL can then be copied and shared, and people who click on it will automatically jump to line 39, with lines 39-45 highlighted.

3. Automatically close issues through the submitted MSG

For example, someone submits an issue github.com/AlloyTeam/A… Then you go to the trunk and change the code, and when you’re done, when you submit MSG, say:

fix  https://github.com/AlloyTeam/AlloyTouch/issues/6Copy the code

This issue will be closed automatically. It’s not just the fix keyword, of course. The following keywords also work:

  • close

  • closes

  • closed

  • fixes

  • fixed

  • resolve

  • resolves

  • resolved

4. Embed Github in HTML

Change the user and repo to whatever you want to display, as shown below

<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>Copy the code

After insertion you should see something like this:

5. Gitattributes sets the project language

As you can see above, Github automatically identifies whether your project is an HTML or Javascript project based on the amount of code associated with the file.

This presents a problem, such as AlloyTouch being initially identified as an HTML project.

There are more HTML examples than JS files. What to do? Gitattributes to help you figure it out. Add the following. Gitattributes file to the project root directory

Github.com/AlloyTeam/A…

The inside of the:

*.html linguist-language=JavaScriptCopy the code

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

6. View access data for your own projects

Under your own item, click Graphs and then Traffic as shown below:

It contains Referring sites and Popular Content details and rankings. Such as: Referring sites

It contains Referring sites representing what website everyone came to your project from, and Popular content representing what files you often look at your project.

7. Trending Charts

Here’s how to view the daily leaderboards for a particular language. For example, js daily leaderboards:

Github.com/trending/ja… Github.com/trending/ht… Github.com/trending/cs… Github recommends: github.com/explore

8, other

  • Enter a colon in “issue” to add an expression

  • On any interface, Shift +? Display shortcut keys

  • “Issue” select text, R key quick reference

The last

Okay, that’s all I have, and it’s a technique I use a lot. Welcome to add practical tips, I will continue to update…

Read more on my blog:

1.Java JVM, Collections, Multithreading, new features series tutorials

2.Spring MVC, Spring Boot, Spring Cloud series tutorials

3.Maven, Git, Eclipse, Intellij IDEA series tools tutorial

4.Java, backend, architecture, Alibaba and other big factory latest interview questions

Life is good. See you tomorrow