News for hackers. Stuff that matters.
Re:A list of cool features of Git and GitHub by teamhappy on Sunday January 18, 2015 @01:00PM (#8908188)
> 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.

Re:A list of cool features of Git and GitHub by sheetjs on Sunday January 18, 2015 @01:53PM (#8908370)
The book has a nice discussion: http://git-scm.com/book/en/v2/Customizing-Git-Git-Configurat...

> 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.

Re:A list of cool features of Git and GitHub by gabrielhn on Sunday January 18, 2015 @04:47PM (#8909054)

    git config --global --unset color.ui
Re:A list of cool features of Git and GitHub by sergiotapia on Sunday January 18, 2015 @10:06PM (#8910072)
Better yet, if you just want to get to work and have a sexy terminal, use https://github.com/mathiasbynens/dotfiles

To install on Mac just run:

    git clone https://github.com/mathiasbynens/dotfiles.git && cd dotfiles && source bootstrap.sh
Re:A list of cool features of Git and GitHub by whizzkid on Sunday January 18, 2015 @01:02PM (#8908196)
File Explorer by pressing "t" is my favorite shortcut on Github since nested file structure gets annoying after a while of looking around.
Re:A list of cool features of Git and GitHub by scotchio on Sunday January 18, 2015 @12:28PM (#8908074)
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

Re:A list of cool features of Git and GitHub by ecaron on Sunday January 18, 2015 @12:49PM (#8908154)
Previous fruitful HN conversation: https://news.ycombinator.com/item?id=7580465
Re:A list of cool features of Git and GitHub by returnofthejedi on Sunday January 18, 2015 @01:23PM (#8908270)
Github should definetely have more Emojis!

Emojis make everything a little bit fun.

Re:A list of cool features of Git and GitHub by krat0sprakhar on Monday January 19, 2015 @12:22AM (#8910468)
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
Re:A list of cool features of Git and GitHub by talles on Sunday January 18, 2015 @02:07PM (#8908439)
> The first commit of a repo, as the first commit cannot be rebased later

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

Re:A list of cool features of Git and GitHub by ekimekim on Monday January 19, 2015 @01:46AM (#8910652)
You can, but it's still a good idea to avoid as it tends to confuse some tools (and some people).
Re:A list of cool features of Git and GitHub by talles on Monday January 19, 2015 @06:51AM (#8911472)
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.

Re:A list of cool features of Git and GitHub by sinkasapa on Sunday January 18, 2015 @01:17PM (#8908249)
One cool feature that isn't listed here is that you can use emacs org-mode files instead of markdown to document your project.
Re:A list of cool features of Git and GitHub by nilved on Sunday January 18, 2015 @02:22PM (#8908498)
There are many different formats you can use: https://github.com/github/markup
Re:A list of cool features of Git and GitHub by niutech on Sunday January 18, 2015 @01:14PM (#8908235)
Any way how to automatically mirror an external Git repo to GitHub? Any webhooks for that?
Re:A list of cool features of Git and GitHub by talles on Sunday January 18, 2015 @02:08PM (#8908452)
https://help.github.com/articles/about-github-mirrors/

tldr; you have to set the hook yourself

Re:A list of cool features of Git and GitHub by bjeanes on Sunday January 18, 2015 @05:55PM (#8909323)
The feature does or did exist, but hidden. The early versions of GitHub Enterprise (called GitHub FI) exposed this and it can be seen in action in some places (e.g.: https://github.com/ghc; look at the "mirrored from" subtitles). I really wish GitHub would expose that feature publicly, though. The post-receive advice they give only works if you have full access to the master repo and misses out on recording the "this is a mirror" piece of metadata on the repository, which is useful for people who might try to open PRs etc
Re:A list of cool features of Git and GitHub by allendoerfer on Sunday January 18, 2015 @01:43PM (#8908334)
The point of git is, that you do not need to do this. Just push.
Re:A list of cool features of Git and GitHub by ekimekim on Monday January 19, 2015 @01:53AM (#8910672)
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...
Re:A list of cool features of Git and GitHub by seanp2k2 on Monday January 19, 2015 @12:12AM (#8910443)
It's somewhat useful as poor man's backup, since forgetting to push to the other remote would be a pretty human thing to do. I guess you could do some kind of bash alias to push both remotes, but that would also assume that both are available from your network location (not sure if Git can have n remotes with one push alias).
Re:A list of cool features of Git and GitHub by returnofthejedi on Sunday January 18, 2015 @01:36PM (#8908308)
Can't we download and then push to github repo?
Re:A list of cool features of Git and GitHub by niutech on Sunday January 18, 2015 @05:09PM (#8909134)
Yeah, but the point is to have it done automatically. It's easier to fork a repo on GitHub than on e.g. CGit, so I would like to mirror an external repo to GitHub and keep it in sync.
Re:A list of cool features of Git and GitHub by christop on Sunday January 18, 2015 @04:15PM (#8908909)
> 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.

Re:A list of cool features of Git and GitHub by oneeyedpigeon on Sunday January 18, 2015 @05:18PM (#8909172)
weirdly, an empty line is included in the example output. Does that not count as whitespace?