2-Version software: Best VCS approach?

I suppose I’d better explain my situation: I’m in the process of developing some software, and I’m at the stage where I’d like to split my project into two branches which differ in features. It so happens that this application is an Android application which I will be deploying on the Market, which has the […]

Find all binary files in git HEAD

I have a huge git repo that eventually want to clean up with bfg. But first, I want to track down and remove files in the HEAD which git treats as binary… So, what i’m looking for is a command to find all files in the HEAD that git treats as binary. These didn’t help: […]

Delete all branches that are more than X days/weeks old

I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? for k in $(git branch | sed /\*/d); do echo “$(git log -1 –pretty=format:”%ct” $k) $k” done | sort -r | awk ‘{print $2}’

git staging and committing between multiple branches

I clearly do not understand git at all. This is what I’m getting: git branch (outputs that I’m on master) git checkout -b foo echo “next line” >> file (file is an existing file) git add file (stages) git checkout master git status (shows that file has “next line” and is staged!!) git commit (commits […]

How to do 'git checkout –theirs' for multiple files (or all unmerged files)

Say I have this after attempting a merge and upon entering git status: # Unmerged paths: # (use “git add/rm <file>…” as appropriate to mark resolution) # # added by them: myfile1.xhtml # added by them: myfile2.xhtml # added by them: myfile3.xhtml … and I know I want to do this for each of those […]

Running git pull from a php script

I was trying the Perfect Workflow, with Git, GitHub, and SSH, and i have everything set up, except running the command git pull from php. When i run exec(‘git pull’) i get: Could not create directory ‘/.ssh‘. Host key verification failed. fatal: The remote end hung up unexpectedly If i run it in the terminal […]

ssh config for multiple bitbucket accounts – Simple example, but getting 'remote end hung up unexpectedly'

Suppose my bitbucket user name is “jon” and I have some personal projects at https://bitbucket.org/jon. Suppose I then join a development team that has a bitbucket account called “devteam” which can be found at https://bitbucket.org/devteam Then suppose I am setting up a new machine. I generate an ssh key pair, id_rsa and id_rsa.pub which are […]

Automatically stashing

The section Last links in the chain: Stashing and the reflog in http://ftp.newartisans.com/pub/git.from.bottom.up.pdf recommends stashing often to take snapshots of your work in progress. The author goes as far as recommending that you can use a cron job to stash your work regularly, without having to do a stash manually. The beauty of stash is […]

Is it possible to view git diffs using a GUI side-by-side tool on Mac?

I really hate visualizing diffs using the default UNIX diff tool. Is it possible to do view git diffs using a GUI tool that will nicely display the local and remote side-by-side, similar how it is possible to set the mergetool to be DiffMerge and when you do git mergetool myfile.txt it pops the DiffMerge […]

How can I get 'git status' to always use short format?

I’d like git status to always use the short format: $ git status –short M file1 M dir/file2 ?? file_untracked3 ?? dir/file_untracked4 There doesn’t seem to exist a configuration option for this, and git config –global alias.status “status –short” does not work. I haven’t managed to create an alias in zsh either. How can I […]

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