Archive for the ‘git’ Category

Git extract folder from project with history and tags

Wednesday, November 2nd, 2016 by Jesper Rønn-Jensen

`git filter-branch` will extract a folder from a shared repository and rewrite history. This tip shows you by example. And also how to rewrite tags in the new repos.

Git tip to remove remote branches already merged

Thursday, August 25th, 2016 by Jesper Rønn-Jensen

Let’s talk about source control and an efficient way of using Git. I like the projects where you have a `master` branch and a few feature branches, which are actively being worked upon. Only a few branches are present at a given time, and this is less confusing for the contributors in the repository. A […]

Change history of SVN repository

Wednesday, April 15th, 2015 by Jesper Rønn-Jensen

Somebody asked me if it’s possible to change history of an SVN repository like you can do in Git. The easiest parts to change are: commit date commit log message With this, you can easily modify time stamps if, for instance, your svn server clock is wrong. Step 1: Modify repository to accept property changes […]

Rewrite author/email in git history

Wednesday, January 21st, 2015 by Jesper Rønn-Jensen

After my harddisk crashed and I reinstalled the machine recently, I misconfigured my Git to set EMAIL as email address. This made Git history look horrible, with incorrect email, image. By accident I even wrote an incorrect name at one point.   Note the missing image.   Now it turns out my git repository was full […]

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, […]

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 […]