GIT Cherry Picking

 Ever had a colleague telling you "hey bro can you please have a look at this commit ?" , or you tell a colleague "hey bro , please check the changes i made with this commit" ? Basically someone else asking you to check the changes they made with a specific commit ? In such a case how do you get the files by a specific commit to your local computer ? Well me , until today , I have been copying those files manually to my local like an idiot. But just now I found out that you can use the built in git command of git cherry-pick for this kind of work! 


Just type git cherry-pick <commit-hash> and you can get your buddy's code onto your local with a blink of an eye. This will automatically commit the commit to your local though , so if you are a man of culture like me just use git cherry-pick -n to stop it from committing. This still stages the changes but least you can have a look at the diff easily this way. I'm pretty sure there must be plenty of other options too but your boy didn't look around as this is a very short note which I am writing just to express my joy and share the good news with you guys. Happy cherry picking !


http://git-scm.com/docs/git-cherry-pick







Comments

Popular posts from this blog

Wasted about an hour of my life on something so trivial

Connecting to AWS DynamoDb with .NET CORE

Hiding YouTube comments section