Friday, February 3, 2017

Me lovin Git

Me lovin Git


As I stated previously, I am sold on DVCS, and today it just got better.

I came across a situation where I needed to share highly experimental code with a teammate. There was no way I could check this code into our normal repo, so what first pops into your head: email (strongbad style). Youve been here and dont pretend you havent used email. Oh yes the wonderful land of emailing around jar or zip files repeatedly.

Emailing source code around stopped today. Instead I got on the phone with Ron Alleva who helped walk me through the simple git commands to create my own local master repo. It was so simple it was ridiculous.

Here are the steps to create and share hack code in minutes
  1. install git
  2. cd to the folder you wish to share
  3. run git init
  4. run git add .
  5. run git commit -a
  6. Have your teammate clone it by running git clone ssh://user@host/path/to/repo.git/
Ironically after my teammate first cloned it and tested the code it failed because of a recent change I made. So I made the fix, committed it to my local repo, and he was able to git pull those changes. Also, if he makes any changes we can share them easily as well by him using git push.

Available link for download