
A list of cool features of Git and GitHub - lmedinas
https://github.com/tiimgreen/github-cheat-sheet
======
teamhappy
> To add more color to your Git output: git config --global color.ui 1

 _Don 't_ do this. The default (since 1.8.4) is auto, which adds colors if the
output goes to a terminal, but doesn't if the output goes somewhere else
(e.g., a pipe). That is probably what you want (and already have).

I fell for this myself at some point. Somehow expecting there to be more
colors, or full color support, or something like that — Nope.

~~~
sheetjs
The book has a nice discussion: [http://git-scm.com/book/en/v2/Customizing-
Git-Git-Configurat...](http://git-scm.com/book/en/v2/Customizing-Git-Git-
Configuration)

> The default setting is auto, which colors output when it’s going straight to
> a terminal, but omits the color-control codes when the output is redirected
> to a pipe or a file.

> You can also set it to always to ignore the difference between terminals and
> pipes. You’ll rarely want this; in most scenarios, if you want color codes
> in your redirected output, you can instead pass a --color flag to the Git
> command to force it to use color codes. The default setting is almost always
> what you’ll want.

------
whizzkid
File Explorer by pressing "t" is my favorite shortcut on Github since nested
file structure gets annoying after a while of looking around.

------
scotchio
This has been posted a few times before and is an excellent resource.

It links to a GitHub repo [1] I made a while ago with every type of emoji as a
separate file and commit as a fun and somewhat pointless demo.

However, for whatever reason the emojis on the repo stopped working (after a
GitHub update?). Each emoji, regardless of commit message, is defaulting to
the last one that was created (:zzz:). I reached out to GitHub a few times
about it, but I never got a response. It's probably super low priority for
them, but I thought I would share since, although minor, I technically broke
GitHub.

[1] [https://github.com/scotch-io/All-Github-Emoji-
Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)

~~~
ecaron
Previous fruitful HN conversation:
[https://news.ycombinator.com/item?id=7580465](https://news.ycombinator.com/item?id=7580465)

------
krat0sprakhar
So you can have a web interface to browse your Git repo with just one command

    
    
      $ git instaweb
    

Wow! Git never ceases to amaze! [http://git-scm.com/docs/git-
instaweb](http://git-scm.com/docs/git-instaweb)

------
talles
> The first commit of a repo, as the first commit cannot be rebased later

Hey, can't I git rebase --root?

~~~
ekimekim
You can, but it's still a good idea to avoid as it tends to confuse some tools
(and some people).

~~~
talles
Ya, I agree. But if you are rebasing I assume you know what you are doing.

More like a _shouldn 't_ (or _really shouldn 't_ if you will) than _cannot_.

------
sinkasapa
One cool feature that isn't listed here is that you can use emacs org-mode
files instead of markdown to document your project.

~~~
nilved
There are many different formats you can use:
[https://github.com/github/markup](https://github.com/github/markup)

------
niutech
Any way how to automatically mirror an external Git repo to GitHub? Any
webhooks for that?

~~~
allendoerfer
The point of git is, that you do not need to do this. Just push.

~~~
ekimekim
There's a slight difference between a git push and a full mirror operation. A
git push only synchronises the current branch. Even git push --all doesn't
necessarily push all reachable commits - tags, other named refs (eg. stash),
the state of the reflog...

------
christop
> Adding ?w=1 to any diff URL will remove any changes only in whitespace,
> enabling you to see only that code that has changed.

Annoyingly, this doesn't work for pull requests.

~~~
oneeyedpigeon
weirdly, an empty line is included in the example output. Does that not count
as whitespace?

