Skip to content

Git tutorial

Diane Maclagan edited this page May 31, 2020 · 8 revisions

Useful Commands:

  • git clone https://github.com/Macaulay2/Workshop-2020-Warwick.git clones the workshop repository; effectively, it creates a local copy on your filesystem. You should run this command in the folder you want to contain the "Workshop-2020-Warwick" folder.
  • cd Workshop-2020-Warwick/ navigates to the cloned workshop repository folder.
  • git branch checks what branch you're on
  • git checkout -b BranchName makes a copy of the branch you're on, names it BranchName, and checks it out.
  • git status Checks the tracking status of files in your local branch (what is or is not staged for commit)
  • git add File and git add Directory adds the file or a directory to the list of files staged for commit
  • git commit -m "Your Message Here" commits the files to the local copy of your branch with a commit message
  • git push pushes the commit to the remote copy of your branch
  • git push --set-upstream origin BranchName sets up remote tracking when you push the branch BranchName for the first time

Other links

This page was copied from the Cleveland 2020 workshop (thanks!). Previous workshops also have comprehensive how-tos. For example, have a look at the info from the Leipzig workshop, and the Madison workshop.

Clone this wiki locally