# How to clone a repo from Hainegroup and update it. Essentially following the doc from Oceanspy ###### tags: how to - Go to Sciserver - Set your GitHub username and email address using the following commands: ``` $ git config --global user.email "you@example.com" $ git config --global user.name "Your Name" ``` - Make sure you've forked a copy of the repo from hainegroup to your profile. - Create a local clone: ``` $ git clone https://github.com/your_user_name/shared-notebooks.git ``` - It will ask you for your password which is your authentication token. To set up your authentication token see here. https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token - Move into your local clone directory, then set up a remote that points to the original: ``` $ cd shared-notebooks $ git remote add upstream https://github.com/hainegroup/shared-notebooks.git ``` - Make a new branch from upstream/main: ``` $ git fetch upstream $ git checkout -b name_of_your_new_branch ``` - Make sure that your new branch is up-to-date: ``` $ git merge upstream/main ``` - This is the branch on which now you make your edits - To stage files ready for a commit, use the following command: ``` $ git add . ``` - To save changes, use the following command: ``` $ git commit -m "Message describing your edits" ``` - You can repeat git add and git commit multiple times before pushing the branch online. - To push the branch online, use the following command: ``` $ git push -u origin name_of_your_branch ``` - Go to your shared-notebooks fork on GitHub (https://github.com/your_username_here/shared-notebooks) and click on Compare and Pull. - Finally, click on Send pull request button to finish creating the pull request.