12 SAO operations on the GitHub

Source: Internet
Author: User

Value | Thinking | Resonance

Brief commentary: The GitHub use guide for liberating productive forces. 1 edit the code on the Github

I'm going to start by saying a lot of people know things.

When you use GitHub, look at some files (any text file or warehouse) and see a small pencil icon on the right side of the top. Click to edit the document. When you are finished, follow the prompts to click "propose file Change",github to fork the warehouse for you and create a pull request.

Very handsome, GitHub created a branch for you.

Do not need to fork/pull/change locally/push/Create PR, just click, you can create a branch.

This is helpful for modifying typographical errors or for malicious tampering. 2 Paste Image

For issue and comment, you can also paste the picture directly, and when you paste the picture will be uploaded to the cloud and then displayed in markdown format.

Very concise.

3 Formatting code

If you want to write a code block, you can write three inverted quotes at the beginning, and GitHub will try to guess what language you are writing.

But if you publish a language such as Vue, Typescript, JSX, you can explicitly write it to get the right highlights.

The first line of the figure below uses the ' JSX:


Fragment Rendering:


(This can be extended to gist, by the way, if you give gist a. jsx extension, you'll get JSX highlights)

Github Support Language List 4 use magic word to close issue in PR

For example, you are creating a pull request to fix issue #234. Then you can input "fixes in PR #234", you can automatically merge PR and close this issue, is not cool.

(The submission can use keywords such as fix/fixes/fixed, close/closes/closed or resolve/resolves/resolved, more please see Help) 5 link to comment

You even want to link to a specific comment, but you can't do it. I'm here to tell you that clicking on the date/time next to the name is all right.



6 Link to Code

If you can link to comment, then you want to ask if you can link to the code. OK.

Try this: When viewing a file, tap the number of lines on the edge of the code.

Wow, did you see that? The URL is updated with it. If you hold down SHIFT and click another line number, the URL is updated again and highlights all the code snippets between the two lines.

You can now share this URL, but wait, these are the current branches, if the file changes. You need a permanent link.

I'm lazy, but the screenshot below has been able to express how to get a permanent link (Copy permalink):

7 using the GitHub URL just like using the command line

Since the URL, so long to talk about. Using the UI to browse GitHub is also very good, but most of the time the quickest way is to use the URL to browse. For example, if I want to jump to the branch being processed and want to see the difference between the branch and master, I can enter/compare/branch-name after my warehouse name.

To put it simply, look at the difference between master and branch, as shown in the following figure:

Can be added after the name ... XXX (branch name) like I wrote Mkdocs...pre-release, the following figure:

This step allows you to work with keyboard shortcuts, Ctrl + L or cmd + L, allowing the cursor to be moved directly to the URL (at least for Chrome). These add together to increase productivity.

Professional tip: Use the keyboard to move a Web page record on a chrome URL and use Shift+delete or Shift+fn+delete to delete a record. (for example, after merging the branches can be deleted) 8 create a list in issue

Do you want to see the list in your issue?


When you look at the problem, do you want it to be a form of 2 of 5.


If you want, you can use the following syntax in issue:

-[] screen width (integer) 
-[x] Service worker Support 
-[x] Fetch support 
-[] CSS Flexbox support 
- [] Custom elements
Project Board on the 9 GitHub

I always use the Jira big project, the independent project uses the Trello, both I like very much.

Later I knew that GitHub also had similar project board:

I personally add them to the note for convenience. Board is very convenient to help you do warehouse management.

You can add something by clicking Add Cards in the upper-right corner. Here are some special syntax to facilitate search, such as: IS:PR Is:open, you can put any public PR to board.

More syntax can refer to search syntax.

You can also convert the existing note into issue.



You can also select issue to add directly to projects.

This means that from now on, you can define the responsibility system, and each line of code can be allocated on Project board on GitHub without going to Jira or Trello.

But it also has some drawbacks, such as fewer functions. You can also try Zenhub, which effectively expands the GitHub.

More questions about board can be accessed: GitHub Help on Projects. Ten GitHub WiKi

The GitHub Wiki can help us deal with unstructured collections of pages, just like Wikipedia does. I Nodejs docs myself as a wiki. Several pages, and then customize Sidebar. A lot of specific methods on the Web, my page can be used for your reference.

Suggestion: If you have a very long single page readme.md file, and want to make a difference with other people, you can try this form. One GitHub Pages (jekyii)

You may already know that you can use GitHub Pages to host a static web site. The article specifically describes how to use Jekyii to build a site.

In the simplest way, GitHub Pages + jekyii will present your readme.md with the most beautiful theme, for example, you can look at About-github's Readme file.

In GitHub's My site, click Setting, Open GitHub Pages, and select a jekyii theme

You will get a Jekyll theme page:

Its advantages are:

Lightweight web site with fast response speed

Web site more secure, no database, no Dynamic Data

No need to access too much energy maintenance

Note that he needs Ruby to run locally, with the Mac self, and Windows users to install themselves. 12 to use GitHub as a CMS

Your site needs to display some text, but you don't want to put it directly in HTML, so you can use GitHub as a place to store your content. This allows any non programmer to modify the content of the HTML page by modifying markdown.

My approach is to use the markdown file in your GitHub warehouse to save the text. At the front of your site, use a component to crawl the text and render it on the page.

I play react, and here's a <Markdown> component that crawls, parses, and renders to HTML.

Class Markdown extends React.component {constructor (props) {super (props); class Markdown extends React.component {&NB Sp
  constructor (props) {     super (props);            //Replace with your URL, obviously      this.baseurl = ' https:/
 /raw.githubusercontent.com/davidgilbertson/about-github/master/text-snippets '; 
            this.state = {       markdown: ',      };   &NBSP}    componentdidmount () {     fetch (' ${this.baseurl}/${this.props.url} ') &nb Sp      .then (response => Response.text ())        .then (markdown) => {  &NB Sp
      this.setstate ({markdown});
        });   &nbsp    render () {     return (       <div Dangerouslyseti Nnerhtml={{__html:marked (this.stAte.markdown)}/>      );   &NBSP}}

(/text-snippets This folder is to store my markdown)

The following code is an example of the above component:

Const PAGE = () => (
 <div classname= "Page" >
 <div classname= "about-us" >
 <markdown url= " About-us.md "/>
 </div> 
 <div classname=" Disclaimer ">
 <p>a very important dis claimer:</p> 
 <markdown url= "disclaimers/home-page-disclaimer.md"/>
 </div>
 & Lt;/div>
);

So now GitHub is also your CMS, whether you want the kind of size of the text can be. Recommend a GitHub tool

Octotree Chrome Extension

It allows you to look at any warehouse and get a tree-like map to the left.

Above.

I hope I can be of some help to you, have a nice day.

English Original: Cool things, can do with GitHub

Click to read the original to get relevant links

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.