Wednesday 22 October 2014

Git add, commit, push – Github

My first experience using GitHub was met with a sea of confusion. "GitHub is a Git repository web-based hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features" [1]. It's used by my MOOCs for grade assessment. Students upload completed assignment files (such as code text documents and images) to GitHub, made available for viewing by other students. I submitted an assignment for the Reproducible Research course and pleasantly discovered that the GitHib submission went smoothly. This was largely due to recalling I needed to be in the right directory. The following are the steps I took to submit my work to GitHub. I have assumed the reader has set up a GitHub account and has installed Git Bash on their Windows machine [2].

First I was instructed to "fork" a repository. I need to define some terms here. A repository is "a central location in which data is stored and managed" [1]. "A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project" [3]. I won't go into the details, but to fork a repository, you follow the GitHub link to the repo (that's what the cool kids call it) and click on "Fork". That's it. The forked repo appears in your list of repositories. The contents of the forked repo are available to you to view. But you are not ready to make changes to the contents of these files and make these changes available to others. In order to do that, a local copy of the repo is required on your computer. In other words, the repo and its contents need to sit in a directory on your computer. The local copy and the repo on GitHub are linked. Changes made to the local copy can be synced with GitHib.

To make a local copy of a repo, you need to clone the repo.

Opening Git Bash [4] I typed "git clone" [5], space then a URL. The URL points to the forked repo (called "RepData_PeerAssessment1"). My username on Git is "DataMoose".


After hitting Enter, the repo appears in my Home directory, as seen below with the folder called "RepData_PeerAssessment1".


When I open the folder I can view the contents. Note that there exists a "PA1_temlpate.Rmd" file. Later I will overwrite this file.


I stated that knowing what directory I was in was for smoother sailing. To check the current directory, type "pwd" (which stands for "print working directory").


I'm in my Home directory at C/Users/Karim [6]. I need to change the directory and point to the repo on my machine. Changing directories is achieved by type "cd" followed by a space, then the folder name (that exists in the current directory) I wish to jump into. Hit Enter.


As a sanity check, type "pwd" again to confirm you are now in the desired directory. A very useful thing to type to get a feel for this directory is "git status" [7]. This returned a status on whether any files in the repo had been modified.


Upon completing my assignment, three files ("PA1_template.Rmd", "PA1_template.html", "PA1_template.md") and a folder ("PA1_template_files") contained figures were produced. I copied then pasted the files and folder into my local repo folder, overwriting the "PA1_temlpate.Rmd" file.

Typing "git add ." will add any new or changed files to git. One can add a specific file by typing out the filename. Use of "." Will add all files in the directory.

Typing "git commit –m" will, I suppose, commit the additions. I'm assuming this step is equivalent to asking "Are you sure you wish to continue?". The "first commit" is my choice of statement. I could write anything and it will display on GitHub. After hitting Enter, the files that are added/committed are listed.


Typing "git push –u origin master" then hitting Enter will prompt for your GitHub username and password. After (correctly) keying these in, stuff (hopefully) appears to indicate that the files have been added to the repo on GitHub.


Refreshing your GitHub repo list, you will see that the new/changed files have appeared (those with "first commit").


That's how we fork, clone, add, commit, push with Git. GitHub is a fantastic (free) tool for version control of your work. In the event you made a blunder, you can rollback to prior versions of files. For my purposes, students can hopefully award me full grades for my assignment.


References and notes
1. I Googled this.
2. I haven’t really assumed this. I'm quite aware people use Macs. I'm a PC, and I wear glasses.
3. Help from: https://help.github.com/articles/fork-a-repo/
4. Allow me a moment to get all colloquial on your ass. Git Bash is an interface that lets me type in single line commands that gets the computer to do stuff, OK? OK!
5. As guided by: https://help.github.com/articles/fork-a-repo/
6. My name is Karim. Nice to meet you.
7. I was guided by: http://guides.railsgirls.com/github/

23 comments:

  1. Hey! What a fantastic post! This is so chock full of information, I can't wait to dig deep and start utilizing the resources you have shared. Your exuberance is refreshing , For more info github training

    ReplyDelete
  2. this is extremely helpful page for all those who struggle updating the git repo's

    Many thanks

    ReplyDelete
  3. Well! If you’re not able to customize employee payroll in Quickbooks while making the list QuickBooks Payroll Support Phone Number in QB and QB desktop, then see the description ahead. Here, you receive the determination of numerous variety

    ReplyDelete
  4. Sometimes errors may possibly also happen as a consequence of some small mistakes. Those are decimals, comma, backspace, etc. Are you go through to deal with this? If you do not, we have QuickBooks Tech Support that will help.

    ReplyDelete
  5. Welcome aboard, to your support site par excellence where all your worries related to the functioning of QuickBooks Enterprise will be addressed by our world-class team of QuickBooks QuickBooks Enterprise Support Number once you go through the blink of a wrist watch. If you're experiencing any hiccups in running the Enterprise type of the QuickBooks software for your requirements, a good idea is not to ever waste another second in trying to find an answer for the problems.

    ReplyDelete
  6. To have more enhanced results and optimized benefits, it is possible to take the help of experts making a call at Support for QuickBooks Payroll. Well! If you’re not able to customize employee payroll in Quickbooks while making the list optimally, in QB and QB desktop, then browse the description ahead. Here, you obtain the determination of numerous variety of information everything you’ve close by for assisting the setup process with comfort.

    ReplyDelete
  7. Because you know how important is the QuickBooks payroll to boost your organization, you need the very best and trustworthy QuickBooks Payroll assist to avoid facing technical glitches and learn many more new stuff like square QuickBooks integration and QuickBooks online accountant to really make the best use of this software using different tools. Just dial QuickBooks Payroll Support Number to operate this unique accounting software without any issue.

    ReplyDelete
  8. The QuickBooks Technical Support Phone Number is available 24/7 to produce much-needed integration related support and also to promptly take advantage of QuickBooks Premier with other Microsoft Office software applications.

    ReplyDelete
  9. Therefore, QuickBooks is present for users around the globe although the best tool to produce creative and innovative features for business account management to small and medium-sized business organizations. If you’re encountering any kind of QuickBooks’ related problem, you'll get all of that problems solved simply by utilising the QuickBooks Support Number.

    ReplyDelete
  10. On September 22, 2014, Intuit publicized the release of QuickBooks 2015 with types that users have already been demanding through the past versions. Amended income tracker, pinned notes, better registration process and understandings on homepage are among the list of general alterations for many versions of QuickBooks 2015. It will help for QuickBooks Enterprise Tech Support Number to possess technical help & support for QuickBooks. In September 2015, Intuit introduced QuickBooks 2016 that covers several enhancements to your existing ones and new types such as batch transaction, bill tracking, continuous feed label printer support, and batch delete/void transactions etc. In September 2016, Intuit launched QuickBooks 2017 with numerous improvements like automated reports, smart search and improved viewing of report filters between alternative activities.

    ReplyDelete
  11. QuickBooks Phone advisors are certified Pro-advisors’ and it has forte in furnishing any kind of technical issues for QuickBooks Technical Support Phone Number These are generally expert and certified technicians of the domains like QuickBooks accounting,QuickBooks Payroll, Point of Sales, QuickBooks Merchant Services and Inventory issues to provide 24/7 service to the esteemed customers. QuickBooks Payroll Services provide methods to your entire QuickBooks problem and in addition assists in identifying the errors with QuickBooks data files and diagnose them thoroughly before resolving these issues.

    ReplyDelete
  12. Professional Services: there are many other services where accounting will be the core area of the complete business functioning. QuickBooks Enterprise Technical Support has something for the as well.

    ReplyDelete
  13. Do not worry after all and e-mail us at our QuickBooks Support Phone Number . Our customer care executives are particularly customer-friendly which makes sure that our customers are pleased about our services.

    ReplyDelete
  14. As well as we have the best account specialists in our team. And are always working round the clock to simply beat your expectations. Our QuickBooks support number is always free and active to deliver you the best QuickBooks Support Phone Number for the great products.

    ReplyDelete
  15. Afterward, Loan Manager will generate just the right loan repayment test every payment interval, once again saving time, reducing errors and increasing precision. In case there is errors, to gain access to the expert services, dial Intuit QuickBooks Support and also for the application, go to Loan Supervisor, to the Banking menu.

    ReplyDelete
  16. If you hire our service, you will be receiving the most effective solution. We're going to assure you due to the error-free service. QuickBooks Tech Support Number is internationally recognized.

    ReplyDelete
  17. QuickBooks Support Number software is helpful for managing the work flow flawless and smooth by prints the payroll components and exchange report are necessary for the modern bookkeepers etc. It is according to application or the cloud based service. Its versions such as:, Payroll, Contractor , Enterprises and Pro Advisor which helps the countless small company world wide .

    ReplyDelete
  18. QuickBooks Tech Support Number Instant Helpline We deliver excellent QuickBooks customer service, superior solutions and individual administration you anticipate from a first-class business accounting firm. We know you’re busy, so we offer every one of our administration’s electronically—giving you 24-hour access to your financial data through a safe online customer focus.

    ReplyDelete

  19. QuickBooks Error Code 6000-301 occurs when accessing the company file in Quickbooks accounting software. This error could be brought on by various defect and damages to QuickBooks desktop.

    ReplyDelete
  20. Well, QB payroll is quite user-friendly but while you already know just about these software things you may face some technical problems while using QuickBooks Payroll Support Phone Number solution.

    ReplyDelete

  21. However, being the average or ordinary business person, taking care of acknowledged and professional accounting software, like QuickBooks Tech Support Phone Number, is certainly not always easy.

    ReplyDelete
  22. It is common to face banking errors like QuickBooks Error code 9999. When such an error takes place, the system tends to freeze for a couple of seconds on repeat. If you would like to learn How To Troubleshoot Quickbooks Error 9999, you can continue reading this blog.

    ReplyDelete