On the third day of Commitmas, my slack friends gave to me - Merging Pull Requests w Git

Dec 23, 2014 • Jonathan Frappier

Today I was chatting with Tim Jabaut in a Slack room Matthew Brender created for Commitmas (ping him or Josh Cohen to get in) and he shared a nice markdown cheat sheet (I seem to be all about cheat sheets during Commitmas). If you have looked at the Commitmas GitHub page you see that Matt and others have made his page pretty; it has been done using markdown. I tried adding some simple markdown to my README file on my Ansible Test Playbooks page but they were just coming over as ##, not as headings.

So, troubleshooting in this new era - it is certainly not done by emailing someone a file! Tim forked my repository to have a look; my README file needed a .MD extension to properly interpret the markdown syntax. With the change complete, Tim issued a pull request which you can see below

The question now becomes, how do I merge that change? GitHub was nice enough to drop me an email with some tips.

Once that is done, you can see I have the changes from Tim in my local repository - my README file is now named README.md

I can now inspect changes to the file that Tim made; for example it may not be something as trivial as a file name. If this were a change say to an Ansible playbook I might want to review what those changes before putting them into the repository. With the file(s) local to me now, I can:

git add .
git push

to merge this change back into the repository. Here you can see the changes before and after my git push.

Day two of commitmas, I have my Windows computer setup and SSH keys added to my GitHub account. Time to clone my existing repository to make a few edits. First, I created a directory on my computer called ‘git’ where I’ll save all my work; cd to that directory and run git init

Yesterday Tim Jabut forked my Ansible test repo on GitHub to help me get markdown working and I merged that back into my repository. Today it is time to learn how to fork a repository on GitHub myself. If you take a look at a repository on GitHub, you’ll see a Fork button on the upper right corner of the page: