Only Push/Pull Current GIT Branch

Posted by & filed under GIT.

With an installation of GIT on a new machine, the push/pull behavior I was used to has changed. I prefer that a push and pull only affects the current branch, not all of them. To set this behavior, globally, run the following commands: git config –global pull.default current git config –global push.default current Now you… Read more »

Visual Git History Log in Terminal Window

Posted by & filed under GIT.

terminal-git-log

My friend Joshua Kalis just showed me this cool trick which allows you to see a visual history (e.g. merges) in your terminal. Normally I bust out GitX-L every time I want to see a visual git history (this is akin to running Photoshop to select a color), but this technique is much more convenient…. Read more »

GIT: Unexpected end of command stream

Posted by & filed under GIT.

Ever get this error: $ git pull origin master fatal: Couldn’t find remote ref master Unexpected end of command stream For me, the problem was that the URL I had entered was incorrect. I had just gotten done pasting the wrong URL: $ git remote add origin http://scrabb.ly/ So to fix it, you’ll want to… Read more »

GitHub Connection Timed Out

Posted by & filed under GIT.

$ git clone git://github.com/creationix/nvm.git ~/nvm Initialized empty Git repository in /home/thunter/nvm/.git/ github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect a socket (Connection timed out) If you are getting this error, it could be that you are behind some sort of corporate firewalls blocking the git protocol. To get around this, you can update the… Read more »

Be Careful when Changing Git History

Posted by & filed under GIT.

While attempting to clean up the git history for the NeoInvoice project (aka removing database exports containing user data as well as passwords hard-coded into PHP file), I somehow was able to duplicate every file in history. So, for every commit, each file now appears to have been committed four times, with the different files… Read more »

Git SSL Errors

Posted by & filed under GIT.

Depending on the type of corporate network your machine is on, they may do some funky things to SSL certificates. For example, completely breaking them and replacing them with a different one. Here’s some example errors that a colleague of mine was having: $ git submodule update Initialized empty Git repository in /home/user/.vim/bundle/NERDTree/.git/ error: SSL certificate… Read more »

Permanently Delete Folders and Files from Git History

Posted by & filed under GIT.

This is an awesome script I just came across. It allows you to permanently remove files and folders form your git history, and is pretty easy to use. git-remove-history If you’re like me, and you have some private repo’s that you want to make public, run that command with the folders you want to cleanup…. Read more »

Pitfalls when Renaming your GitHub Account

Posted by & filed under GIT.

So, you’ve decided to rename your GitHub account to something else, and you’re not too sure how much danger you’ve got in store for yourself eh? Well, lucky you, I just did a GitHub account rename (from renownedmedia to tlhunter) and I’m here to tell you everything to look out for. It’s really not as simple… Read more »

Global gitignore vs repository gitignore

Posted by & filed under GIT.

Most people are aware of the .gitignore file which can be placed in the root of your git repository. This file can contain a list of files specific to the project which shouldn’t be committed into the repository. This file should be used for ignoring files which your project generates, such as build and temp type directories…. Read more »