If you have never used git before, you may want to check out this introductory tutorial.
-
Create a new private GitHub repo named
ECE346_GroupXX
(you can follow the steps here). -
Open a Terminal window on your computer.
-
If you haven't already, create a clone of the
ECE346
repository on your machine. Go to the cloned directory.git clone --recurse-submodules https://github.com/SafeRoboticsLab/ECE346.git cd ECE346
-
From inside the cloned directory, rename the original
ECE346
GitHub repo fromorigin
toupstream
, to fetch future lab assignments and updates.git remote rename origin upstream git remote set-url --push upstream DISABLE
-
Set your freshly created private repo as the new
origin
using the URL assigned to it on GitHub. The URL of your private repo can be found on the main page of your GitHub repository (online). After you navigate to the main page of your GitHub repo, select the green <>Code icon. Under the Clone category, select SSH and copy this URL. (NOTE: At this point, you should have already setup your GitHub SSH Key. If you didn't, this step will not work.)git remote add origin <URL of your private Repo>
-
Push the
SP2023
branch from your local clone repo to your new remote one, which has now become a private fork ofECE346
.git push -u origin SP2023
When woking on the labs and making changes to your code, you can push the code to your private repo on GitHub by simply doing:
git push origin
Not sure about merge? It is never a bad idea to keep a copy locally before merging.
- Create a temporary local branch on your computer.
git checkout -b temp
- You can now merge the original
upstream
repo into your local branch.This will create a merge commit for you. If you encounter any conflicts, this tutorial can help you take care of them.git pull upstream SP2023
- Inspect all changes that you have made in the temporary branch, then checkout your SP2023 branch.
git checkout SP2023 git merge temp git branch –-delete temp # Update submodules in case there are any git submodule update --init --recursive
Once you are fully comfortable with the git merge workflow, you may want to skip steps 1 and 3 and pull directly into your local SP2023
branch.