Tag Archives: git

Git and Cherries

0
Filed under Development
Tagged as , ,

Today I needed to pick some specific changes from a local git branch and merge them to another. git cherry-pick does the job.

Usage:

git log source_local_branch #check the sha1 hash of the commit we want
git checkout destination_local_branch #switch to the branch we want to merge the commit.
git cherry-pick -x <commit_id>

the -x parameter adds the original commit id to the commit message.



				

Showing trailing whitespace in Vim

0
Filed under Development
Tagged as , , ,

Git has been warning me for leaving trailing whitespace in code files every now and then. So I decided to put this in my .vimrc:

Source: here

Showing current git branch on shell prompt

2
Filed under Development
Tagged as , , , ,

Found this useful piece of code to put into .bashrc, which shows the current branch when the current working directory is versioned by git.

Vim settings

0
Filed under Development
Tagged as , , , , ,

I used to carry all my vim settings in a .tar.gz file wherever I would go. Sometimes it would get messy because I would forget to get something from somewhere so I would need to create it from scratch. Now I’ve got everything in a public git repository, and I hope it could be useful for other vim beginners too.

The repository can be found here.