Run script before commit and include the update in this commit?

I wrote a script that generates Readme.md file (for GitHub) by scanning the source code. Everytime before I make a new commit, I run this script manually to update Readme.md. It sure would be better if this job being done automatically. Currently I’m using pre-commit git hook, which works only partly. The Readme.md file gets […]

git hook to create staging branch

I am hosting my code on Bitbucket. The webhooks are not adequate to solve my issue, so I am hoping git hooks will work. Since I don’t imagine they will work server-side, the git hook should be propagated to each checkout on each developers machine. (I know this might be an issue since its normally […]

What does interdiff do that diff cannot?

If I’m trying to find the diff between two diffs, why can’t I just diff the two diffs? I have tested diff diff1 diff2 and interdiff diff1 diff2 and have not found any difference in the output. In what case would they be different? (I am fully aware that interdiff’s stated purpose is to find […]

Export specific Git commits as patches

I am trying to export several commits (those that contain a specific ticket number 1234 in the commit message) to patch files. EDIT The working script is on https://github.com/amenk/SelfScripts/blob/master/git-extract-patches This is what I have #!/bin/bash -x commits=`git log –pretty=oneline | grep “#1234″ | cut -f1 -d” “` no=1; for COMMIT in $commits do git format-patch […]

Set SSH Identities In Bashrc

I have a .bashrc file to start my ssh agent (taken from here). Whenever I start my machine I keep having to add my identities to it (using ssh-add ~/.ssh my_private key). Not knowing bash scripting much, what (and where) do I adjust this script to add in my identities? SSH_ENV=”$HOME/.ssh/environment” # start the ssh-agent […]

How can I make git tell curl to use openssl instead of gnutls without rebuilding the package?

We have an internal server that GnuTLS doesn’t like, e.g: gnutls-cli –x509cafile /etc/ssl/certs/ca-certificates.crt foo.example.com Processed 173 CA certificate(s). Resolving ‘foo.example.com’… Connecting to ‘1.2.3.4:443’… *** Verifying server certificate failed… *** Fatal error: Error in the certificate. *** Handshake has failed GnuTLS error: Error in the certificate. Everything other than GnuTLS talks to it ok, but git […]

SourceTree filemerge quits immediately and creates 4 files. How to fix it?

yesterday I could merge files in sourcetree with the external tool filemerge. Today, sourcetree wanted me to register me, and after my successful registration, I couldnt start filemerge. When I choose “Launch external diff tool” from the contextmenu of a file, 4 files appear (Backup, base, local and remote) but filemerge quits immediately. When I […]

Multiple repositories in one directory

This is a question that seems to come up semi-frequently, but sadly I’ve not found an answer that I can fully apply to my situation yet, so I figured I’d ask my own question. This is my first question on SO, so be nice. 😛 The “problem”: Our company develops multiple PHP applications, however one […]

How can I add/update a submodule, using an existing repository to save bandwidth?

Say I have some big repo, BigRepo, and I want to add it as a submodule for another project. Normally I would do $ git submodule add git@somewhere.com/me/BigRepo.git but I don’t want to download the whole thing again. Luckily I already have a checkout of it, so I try $ git clone ../BigRepo Cloning into […]

Git Revert Error Message?

While trying to revert a commit I made to my repository of my .emacs.d folder I get the following message: haziz@haziz> git revert 7fe3f error: could not revert 7fe3f0b… .emacs.d contents from ubuntu hp 15 hint: after resolving the conflicts, mark the corrected paths hint: with ‘git add <paths>’ or ‘git rm <paths>’ hint: and […]

Git Baby is a git and github fan, let's start git clone.