Posts Tagged ‘git’

Git checkout old revisions by date

Friday, November 9th, 2012 by Jesper Rønn-Jensen

I wanted to do some code stats for a repository. This line checks out old revisions by date and shows code stats: git checkout `git rev-list -n 1 –before=”2012-03-01″ master` Then, I ran cloc to count lines of code: cloc . Its really easy to register the point in time as a git branch so […]

Forgotten Subversion Commands, Undo, Merge Branches and More

Thursday, June 28th, 2012 by Jesper Rønn-Jensen

In a current project I use a lot of Subversion (svn) from the command-line. Subversion recently has lost terrain to Git for several reasons. But actually, svn is capable of doing many of the things I love from Git. Here are some less known commands I find extremely helpful.   Undo last commit svn merge […]

Collection of useful Git Tips to get started

Friday, September 30th, 2011 by Jesper Rønn-Jensen

I thought it was time to collect some of my most useful findings when working with Git. These are typically from situations where I found a useful way, which I wanted to jot down. Also I have answered and asked some questions on StackOverflow. The good thing about it, is that I am always able […]

How to make Git ignore files that already exist in your project

Monday, December 7th, 2009 by Jesper Rønn-Jensen

For a project I’m working on, I had to change some files with personal settings, and the files kept showing up with a git status. Adding files to .gitignore that are already tracked does not work. (and it’s actually pretty well documented in the documentation). In stead, it’s possible to use this command: git update-index […]

Spoken Git Commit Log — Another Annoyance at the Office

Wednesday, September 30th, 2009 by Jesper Rønn-Jensen

Here is a short one-liner that really annoyed my colleagues today. I set my mac to read aloud all changes in the repository since yesterday: git log –pretty=format:”%an commit %s, %ad.” –date=relative –since=yesterday |say if you remove the “say” command in the end it’s actually pretty readable: pagerbak commit VA17, 34 minutes ago. pagerbak commit […]

How to add Git Pull Shortcut to Different Github Branches

Sunday, August 23rd, 2009 by Jesper Rønn-Jensen

UPDATE 9 hours later: Changed to “remote = origin” to the specific branch “remote = dean” which works! Short explanation on how to pull changes from different Git repositories into your local Git repository. Last week I worked with three different Github forks of a project. Now for standard, when you clone a Github repository, […]

Importing Existing Git repository into SVN

Wednesday, July 8th, 2009 by Jesper Rønn-Jensen

Many of my colleagues know svn but are in general not (yet) ready jump over to using Git for bigger projects. Today I had to import my existing Git repository into SVN. I had been working locally with a Git repos and wanted to keep my history before giving access to my colleagues. The guide […]

Using Git for SVN Repositories Workflow

Monday, March 9th, 2009 by Jesper Rønn-Jensen

For the last months I have been using Git to work with my Subversion repositories. Besides from reducing disk usage, Git also makes my work slightly faster and independent of network access — I can make commits to repository which is sync’ed later when I get online. One challenge though: Using branches I ran into […]

Using Local File-based Git — Server Laziness

Saturday, February 21st, 2009 by Jesper Rønn-Jensen

My problem this week: I wanted to share some work with a colleague. Unfortunately we have not yet setup our caplab environment with git server. Nor did i want to push this particular project to GitHub or Unfuddle. My alternative was a file-based setup: Each developer’s machine has it’s own Git repository. On my machine […]

Git Side Benefit: Reducing Disk Usage

Saturday, January 17th, 2009 by Jesper Rønn-Jensen

A side benefit of switching from Subversion to Git for source control is that Git does not use shadow files and directories to find out what has changed. I created two checkouts of a svn project — one using traditional svn and one using git (which can actually clone a svn repos — see explanation […]