How To Use Git With Just The Gui Part Two
Monday, 19th March 2012
In my previous article I detailed the three steps required to get a GitHub project onto your machine in order to make awesome contributions. This time around, we're going to get the features or bug fixes you made all the way back to the original project on GitHub. Best of all, we will do it all without using command prompt (or as we now call it "pissing behind a tree").
Step 1 - Committing Changes Locally
Each time you make a change, it is worth committing it locally. This makes it easier if you need to roll back a misguided coding session. To commit your changes locally, menu-click on your local folder and open the Git Gui.
Any files you have changes will appear in the "Unstaged Changes" section. If you make changes while the Git Gui is open, just hit the "Rescan" button and they will appear. You can select individual files to commit by double-clicking on their icon, or you can move all changed files using the "Stage Changed" option. This option will also prompt you to add any new files that aren't under source control, but you can opt to ignore them if you want to.
Once you have selected the files to commit, hit the "Sign Off" button and add any comments you want to associate with the change. If your details aren't correct, you can update them in the "Edit" > "Option" menu. You may need to re-start Git Gui for these changes to take effect, but it will save you correcting the sign off details every time.
Now you have added an appropriate check-in comment and signed off the changes, use the "Commit" button to finish off. The change is now committed to your local clone.
You may have already noticed, but all of the buttons on GitGui are in the correct order to help you with this workflow.
Step 2 - Sending the Changes To Your GitHub Repository
When you have a set of changes that you would like to protect from hard-disk failure, you can send all your local changes to the GitHub repository you created when you forked the original project. To do this, open the Git Gui as normal and hit the "Push" button. By default, the dialogs will be pre-completed with the correct details (your GitHub repository will be referred to as "origin" - so simply proceed through the dialogs and enter your password if you get prompted for one. You'll get a satisfying green bar when the changes have been sent.
Step 3 - Sending the Changes Back To The Original Project
When you have completed an entire feature, you are probably ready to send it to the original project.
To do this, log on to GitHub and view your repository. You'll see a "Pull Request" option. This will issue your changes back to the original project and allow the project owners to review the changes and merge them into the main project.
Step 4 - Bask In The Glory
So there you have it. There are three steps to get the code out and three to put it back - and we didn't need to use a command line instruction a single time.