svn for git-addicted or git-svn gotchas and WTFs – Part 2

Part 1 Hi folks. Let’s continue our git-svn adventures. In the previous blogpost we’ve managed to fetch the whole svn repo. Let’s discuss some pitfalls. Local branches this will create a local branch and keeps track of svn version of it. Main commands to keep yourself updated svn tags For whatever reasons git-svn gets svn …

svn for git-addicted or git-svn gotchas and WTFs

Hi folks I’d like to talk about svn, git-svn, SubGit and SmartGit. I joined a new company and they are using svn. It is a choice of client, so we cannot change it easily. I am a Tech Lead so I can force them to switch, but I don’t really want to do this without …

git – fight with pull merges

Hi folks! I am a big hater of pull merges, i.e. commit with messages like Merge branch ‘mybranch’ of http://my-url:repo into mybranch It normally appears after git pull in scenario when you made some commits in your local branch, and someone else made some commits in his version of local branch then he pushed it …

git server-side hooks – maintenance

Hi folks. Server-side hooks that I wrote previously has one huge shortcoming – Maintenance How do I modify server-side hooks at the moment? I edit the hook on a client-side, then commit and push. After that I connect to a git server via Remote Desktop, and manually update hooks in the corresponding folder. This is …

Detect Console mode vs UI

For my git hooks I needed to distinguish if git command was called from console or from UI (Git Extensions), because I wanted to have console prompts in first case, and WPF GUI in second. At some stage we found one very complex implementation which worked fine with cmd, PowerShell, Bash and Git Extensions, but …

Parse git merge commit messages

Sometime traversing git history, I need to determine what branches were merged at some point. By default git constructs merge commit message by itself. And if nobody changes that it can be parsed to get the merged branch names. Using history of our git repo for last two years, I took all the merge commit …

Interesting git helpers snippets

I would like to share some useful git snippets, which I’ve used in my git hooks. Snippets originally written in PowerShell but can be easily rewritten for your favorite language. Here are the full sources Get current branch name Safely resolve ref It returns hash of the valid ref, or $null for invalid ones. Test …