From 83eaa81561388143dcd8ad506627e2bb41a00c31 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Mon, 19 Aug 2019 20:26:03 -0700 Subject: [PATCH] Add minimal docs for using git Only a few workflows are covered: cloning, updating, reverting to upstream, and pulling unmerged changes. --- Docs/What_the_git.md | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Docs/What_the_git.md diff --git a/Docs/What_the_git.md b/Docs/What_the_git.md new file mode 100644 index 0000000..1688744 --- /dev/null +++ b/Docs/What_the_git.md @@ -0,0 +1,51 @@ +# What the git?!? + +An incredibly basic guide to using a tiny part of git. + +This document focusses on how to fetch a git repo, update it, and pull +changes from other repositories. + +# Creating a repo + +`git clone ` will download a repo. If the download is taking a +while you can save some time with `git clone --depth=1`. This avoids +fetching the full history, which can be especially useful if the +history is full of old Voron STLs. + +When you are fetching from Github you can fetch via SSH or HTTPS. The +latter can be preferred as you will not need a Github account or +credentials set up. After clicking "Clone or download" make sure you +see "Clone with HTTPS", and click "Use HTTPS" if you don't. + +# Updating a repo (#updating) + +To fetch the latest changes, run `git pull origin`. Note that your +current working directory will need to be inside the repo. + +If you've made some local changes there's a chance this command will +fail. There are plenty of ways to fix it that are complex -- one +simple way is to blow away all local changes and start fresh: + +``` +git fetch origin +git reset --hard origin/master +``` + +Note that this *will* undo any changes you've made. + +# Fetching from another repo + +Sometimes a fork will have a change you want to try. You can wait for it +to be merged back into the main repo, or you can fetch it directly into +your repo. To do this, run `git pull `. This will +compare your repo to the one you provide, retrieve all commits that are +new-to-you, and attempt to apply them to your local copy. + +Sometimes the retrieved changes overlap with changes in your repo, and +conflict. This can happen due to changes you've made, or if two changes +from different repos overlap. When this occurs git will print an error +about a conflict, and ask you to fix it. + +The most reliable way to fix it is to start fresh, using the command above +in [Updating a repo](#updating). +