Wrap-up

Last updated on 2024-03-12 | Edit this page

Overview

Questions

  • Where can I learn more about using git?

Objectives

  • Be familiar with useful resources for git

RECAP

  • The goal of this session is to become familiar with git and provide users with the confidence to use it in their study and work.
  • After today you should have created a GitHub account and configured your computer to use git version control software.
  • We stepped through an example that demonstrated the power of git version control in tracking history and changes.
  • This workshop provided a practical and ‘hands-on’ introduction to git.
  • We did not cover all aspects of version control/git theory but hope you can now begin to navigate the world of git after today.
  • An important part of your git journey is learning how to navigate through online resources and find meaningful help.

Additional software carpentry lessons we did not cover today

We did not cover all lessons in the software carpentry suite today. After today’s workshop you may find it helpful to navigate your own way through the remainder of the lessons to sharpen your new git skills.

A list of additional git novice lessons:

Where to get help


References for git/GitHub


Git cheat sheets:

Resources

  • An interactive one-page visualisation about the relationships between workspace, staging area, local repository, upstream repository, and the commands associated with each (with explanations).
  • Both resources are also available in other languages (e.g. Spanish, French, and more).
  • Happy Git and GitHub for the useR” is an accessible, free online book by Jenny Bryan on how to setup and use Git and GitHub with specific references on the integration of Git with RStudio and working with Git in R.
  • Open Scientific Code using Git and GitHub - A collection of explanations and short practical exercises to help researchers learn more about version control and open source software.

Help on error messages

These helpful coding tips have been inspired by Y. Wendy Huynh from R for Graduate Students…(p.s. yes I know we are using git and not R here, but many tips still apply 😄)

Some common mistakes to watch out for when coding

  • Capitalization
    • You typed an uppercase letter when you should have typed a lowercase letter (vice versa).
    • Depending on the situation capitalization does not always matter but to be safe its best to make sure it does match.
  • Mis-spelling
    • Sounds obvious but might be surprised out often this is the problem (especially when starting out). Use the tab auto-complete features where possible or the old copy-and-paste usually works.
  • Closing Punctuation
    • Don’t forget to close any parentheses, bracket, or quotation if you use them.

Searching the web

As you navigate the world of code let me introduce you to your new bestfriend…Stack overflow. An excellent resource to find help on error messages for new and experienced users alike!

Everybody – beginner and expert alike – will Google how to code something at some point. The real skill that experts have over beginners is that experts know how to strategically Google. For that, you want to master these skills:

  • Make sure that your question is specific and reproducible.
  • Don’t forget to include the language/tool you are using e.g. “git”.
  • Remove text which is specific to you (i.e. the name of your repository or file).

Searching an error message

You received the following error message and wanted to find help on the web. What parts would you put into a search engine?

ERROR

From https://github.com/siobhon-egan/planets
   1e7a65e..2b65923  master     -> origin/master
error: Your local changes to the following files would be overwritten by merge:
	myNewFile.sh
Please commit your changes or stash them before you merge.
Aborting
  • Including the first two lines of the output in the search won’t help, as the repository URL and commit log ID are unique to me.
  • The third line (error: Your local changes to the following files would be overwritten by merge:) tell us the type of error encountered here. This is probably going to be the most helpful to enter into a search engine.
  • The fourth line is just the name of my new file in the directory and won’t be helpful.
  • The fifth line explains how to fix the error, but you may not know exactly the steps to do this. Searching for help on this line might also retrieve some useful tips
  • Searches for the final line (Aborting) probably won’t yield many useful results.

Key Points

  • Keep a copy of GitHub cheat-sheet handy when starting out. PDF copy
  • GitHub Docs pages is your go-to for extensive documentation.