GitHub - Tips & tricks

Maxence POUTORD

#1 - Github = Git + hub

hub.github.com

Installation


# MacOS
$ brew install hub

# Unix
$ git clone https://github.com/github/hub.git && cd hub
# assuming that `~/bin` is in your PATH:
$ script/build -o ~/bin/hub

$ alias git='hub'

$ git --version
git version 2.7.4
hub version 2.3.0
      

$ hub


$ git

# ...

These GitHub commands are provided by hub:

 pull-request   Open a pull request on GitHub
 fork           Make a fork of a remote repository on GitHub and add as remote
 create         Create this repository on GitHub and add GitHub as origin
 browse         Open a GitHub page in the default browser
 compare        Open a compare page on GitHub
 release        List or create releases
 issue          List or create issues
 ci-status      Show the CI status of a commit

      

#2 - GMF: a Markdown on steroid

guides.github.com/features/mastering-markdown

Tables


| First Header  | Second Header |
| ------------- | ------------- |
| Content Cell  | Content Cell  |
| Content Cell  | Content Cell  |
      

Syntax color


```
if (score === 100) {
  console.log("Yihaaa!")
}
```
      

```javascript
if (score === 100) {
  console.log("Yihaaa!")
}
```
      

blockquote


> this text is quoted
      

Or better: select text and press  R 

Want more shortcut key? press  ? 

Task Lists


- [x] Prepare slides
- [ ] Give this talk
- [x] @maxpou fix issue #1
      

...and other HTML Tags


License (MIT) The MIT License (MIT) Copyright (c) 2017 Maxence POUTORD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software") [...]

#3 - Github Pages

pages.github.com

Static website

(plain old HTML/JS/CSS)

Jekyll

Deploying


$ git push
      

URL

Managing dependencies?

Think about git submodules!


$ git submodule add https://github.com/hakimel/reveal.js
      

#4 - URL everywhere

To exist, each action must have a specific URL.

Removing whithespaces

github.com/user/repo/commit/commit_sha1?w=1

highlight lines

github.com/user/repo/commit/example#L3-L5

#5 - Emoji šŸ˜

Emoji cheat sheet

Good example: Atom contributingā€™s style guides

#6 - Templates

Issue #1

User: It didn't works.
Maintainer: Which version are you using? What is your OS/Browser... Can you provide the steps to reproduce?
User: ...

Issue #2

User2: It didn't works.
Maintainer: Haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Template to the rescue!


(ISSUE_TEMPLATE.md)

| Q                | A
| ---------------- | -----
| Bug report?      | yes/no
| Feature request? | yes/no
| BC Break report? | yes/no
| RFC?             | yes/no
| Tool version     | x.y.z

**Description**

**Version concerned**

**Steps to reproduce the issue:**
1.
2.
3.

**Expected Results:**


**Actual Results:**

**Additional details:**
      

Full article


maxpou.fr/github-tips-and-tricks

Thank you

Questions?


@_maxpou

#7 - Bonus: Octodex

octodex.github.com

#7 Bonus (bis)

I have some stickers!