HackerNews talks Git
GitHub as a blog - creative “mis”use of technology


Git is not better than Subversion. But is also not worse. It’s different.


The key difference is that it is decentralized. Imagine you are a developer on the road, you develop on your laptop and you want to have source control so that you can go back 3 hours.


With Subversion, you have a Problem: The SVN Repository may be in a location you can’t reach (in your company, and you don’t have internet at the moment), you cannot commit. If you want to make a copy of your code, you have to literally copy/paste it.


With Git, you do not have this problem. Your local copy is a repository, and you can commit to it and get all benefits of source control. When you regain connectivity to the main repository, you can commit against it.



Github vs Bitbucket (infoworld)


Pro Git


Git Best Practices




I’ve used Tortise Git (see below) in the past, but found that I do everything on the commandline, and ignore the whole Tortoise GUI portion.




On a new system, I’m installing git via Chocolatey. See this list of Chocolatey git packages.


mysysgit has been deprecated in favor of git



usage notes

A simple git branching model


git add --patch -- or -- only adding some changes

You can do git add --patch filename.x (or -p for short), and git will begin breaking down your file in what it thinks are sensible “hunks” (portions of the file). You will then be prompted with this question:


Stage this hunk [y,n,q,a,d,/,j,J,g,s,e,?]?



clone into folder without history

If you just want to start a new project without the angular-seed commit history then you can do:


git clone --depth=1 <your-project-name>


The depth=1 tells git to only pull down one commit worth of historical data.


The Pull-Request Hack

Whenever somebody sends you a pull request, give them commit access to your project.




Somebody sent a pull request for a project I was no longer using myself, and I could see an issue with it right away. However, since I no longer cared about the project, and the person sending the pull request did, I simply added him as a collaborator and said something like this: “I don’t have time to maintain this project anymore, so I gave you commit access to make any changes you’d like. It would be nice to follow the style used by the rest of the code and add some tests to this patch.”.


The result was pure magic. Within a few hours the same person who had just submitted a rather mediocre patch, had now fixed things up and committed them.



Undo git add prior to commit

git reset HEAD <file> (source)


You can use git reset without any file name to undo all due changes.


to fork, to clone, or not

Please don’t fork or clone if …
Where GitHub (Possibly) Went Wrong - doesn’t encourage collaboration



List branches

  • list all local and remote branches
    • git branch -a
  • list only remote branches
    • git branch -r


There’s also git remote and git ls-remote to list more info.


See list remote branches and probably git docs.



This came from which hasn’t been updated since 2011; but Git really hasn’t changed all that much, anyway.


Sync a fork with the master repo/update to master

This cannot be done on github, must be done on command-line.


This is a concise summary of commands -- more explanation and verification at source:


git remote add upstream
git fetch upstream
git checkout master
git merge upstream/master


Now, push changes to the repo.






Integration and completion via PowerShell !!


Better Git with PowerShell
Streamline Git With Powershell




I’m trying to use more Powershell... so, bit by bit.... plus, even though I’m in powershell, all of my GnuWin32 tools still work (AFAIK).








  • The easiest way to use git. On any platform. Anywhere.
  • Clean and intuitive UI that makes it easy to understand git.
  • Runs on any platform that node.js & git supports.


intro video


I’ve been using “Git for Windows” (git version 1.8.0.mysysgit.0) at the same time that I have git for cygwin.
Since I’ve always been using the “Git Bash Here” command to launch the shell, it’s been a long time since I realized I had Cygwin git installed.
HOWEVER, mysysgit wasn’t on the PATH, so ungit cried foul, declaring that first, it needed git >= 1.8.0 and cygwin git is only 1.7.x.
So, I uninstalled cygwin git (and apparently updated everything else in Cygwin. yay. :::sigh:::).
Then ungit sez it can’t find git at all (really “unable to run git --version”).
So then I added it to the path.
At the end.
And it seems to work.


Can consume a serious amount of CPU that sets off the fan on my laptop.
Yesterday I had to reboot to get it to slow down.



Also: by default, ungit wants to go to your “home” directory.
On Windows7, that was C:\Users\mpaulukonis
Charmingly, something about Windows7 wouldn’t get a response from that directory in any reasonable time period.
Once I reset it to something else (d:\temp) I got the “no repos here” page.



Apparently, I need to set the username in my .ungitrc file:
 is a content editor for GitHub designed for managing websites. And it works pretty smoothly.
HN: Introducing (2012)



Tortoise Git (for us Windows “snobs”)


TortoiseGit is a simple wrapper around msysgit, which is a Windows port of the git version control system.


You can download msysgit from their Google Code project page. You want the one with the description “Full installer for official Git for Windows”


This worked for me. Although getting Tortoise git going with BitBucket was still a hassle.
(UPDATE a couple of months later: really, what was the problem? I don’t recall.)
I used the command-line for a while. (UPDATE a couple of months later: aaaaaand, what’s so bad about that?)


mysysgit is installed at d:\dev\git and it is Git-1.8.0-preview20121022


Honestly, I’m using the command-line almost exclusively as of 2013.05.29.


tgitcache cpu usage

Sometimes TGitCache.exe can consume a significant chunk of CPU power for way too long.


The below solution seems to work, although it is less than perfect:


  1. TortoiseGit→setting → Icon Overlays choose “Shell” or “None” to disable  TGitCache.exe.
    1. It will loss some icon overlays features, but it should be quick.



using github

api info (json) - similar to
NaNoGenMo bot parses issues to get info: (python)



General Usage

GitHub best practices



Set up git - including notes on authentication.
I’m using ... some install of git, not cygwin nor Gnu core tools.
And I have a pass-phrase that I fat-finger 3/4 of the time



git config --global github.user username
git config --global github.token blah
git config -l - create Personal Access tokens


pull request from a branch of a fork of a fork


I forked a fork, since my contribs were based on changes not yet present in the head project.
My first pull-request worked properly to the head.
My second pull-request ended up being on the fork.
No idea what I did differently.
I tried some command-line options, but they got me nowhere.
HOWEVER, the below steps seem to have worked:


  1. go to Master project
  2. Pull Requests
  3. New Pull Request
  4. Compare across forks
  5. Select head fork repository: will be comparing base:master to head:master
  6. switch the base (not really available on the above page)
  7. Edit >> change head fork compare: <branch>
  8. View Pull Request


move an existing (bitbucket) repo into github

  1. create the repo in github (don’t add the file)
  2. navigate to repo
  3. git push --mirror<username>/<repo>.git
  4. authenticate
  5. bob’s yer uncle


Oh, aaaand, I may have edited /path/to/repo/.git/config as
url =


I mean, I did. Don’t know if that helped nor hurt.
Based on and


markdown for the


See Emacs.OrgMode#markdown for Emacs integration.


Github Pages ( - NOTE: in-sync means THE SAME


git checkout -b gh-pages // if does not yet exist
git checkout gh-pages // go to the gh-pages branch
git rebase master // bring gh-pages up to date with master
git push origin gh-pages // commit the changes
git checkout master // return to the master branch


Your project will be shortly live @ http://<username><reponame>


Hey! What if your gh-pages branch is different from master... that is NOT IN SYNC.
Wait... why would that even be?
Well, let’s say that master relies upon node_modules that are never committed, but your gh-pages branch.... needs to have these node_modules present (since you are, apparently, using them for both node and web.).


instead of rebase-ing, checkout individual files from the master branch:


git checkout master where we assume the branch is master.


new repo

git init
git add
git commit -m "first commit"
git remote add origin
git push -u origin master







Git Hub

Private repos cost money.


Notifications & Stars


See Also: SocialMedia#github !!!



Private repos are free (5 of them?)
Public repos unlimited
I store non-public repos in bitbucket.




My notes on using Git (which need to be cleaned up)


have a login -- check passpack if you forget
create a new private repo called


also see:,unversionedcodeprojecttoanemptyrepository


  1. go to directory (I used “open git bash here”)
  2. git init
  3. git add .
    1.    this presumes you want to add everything.
    2.    if you don’t.....
    3.    see .gitignore @
  4. git commit -m "some message"


on bitbucket, I chose “Push up an existing repository”
  on the above getting-started link it is labelled differently


  1. cd /path/to/my/repo -- I skipped this step, as I was already in the repo via the git bash
  2. git remote add origin
  3. git push -u origin --all   - to push up the repo for the first time


it then prompted me for my password (see passpack)






pretty much the same, only I followed git instructions for creating a new repo
It allows you to pre-create a file, which I did
and so, when I attempted to push... IT FAILED


$ git push origin master
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to ''
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


so, I had to


$ git pull
 * branch            HEAD       -> FETCH_HEAD
Merge made by the 'recursive' strategy. | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644




$ git push origin master


worked like a charm


moving files around in a repo

So sue me. I change my mind. Thank g-d this isn’t like CVS or (ugh) VSS.
The experience wasn’t exactly pleasant as I kept fat-fingering things and couldn’t keep mental track of the original and proposed directory structure in my head, but I got it there.
One more move to go, I think. then we’ll be set.....



wordpress deployment



Link Dump

Programmers.StackExchange: Are Frequent Complicated Merge Conflicts A Sign of Problems?


See Also




No comments yet.



Add Comment

 Your Message
 Enter value ← Have you entered the code number?