Create a new repository on github using the fork link under the piazza#resources tab.
Under the resources tab in piazza, you should be able to find a link to Lab 2 and Lab 3. If you haven't clicked on it and created a repostory for lab2 and lab3 already, then you can just click one of the following links.
- Navigate to the GitHub landing page for the respective lab repository.
- Click on the button that says Clone or download and copy the link.
- On your local machine, navigate to the directory that has your lab2/lab3 code (the one that you had earlier cloned into).
- To make sure you're in the right directory,
- type the command
git remote -v
. You should see links that contain binghamtonuniversitycs-240 in them.
- type the command
- Now, run the following commands to set a new remote link (the one you copied from the GitHub landing page) as origin.
- type the command
git remote set-url origin <new url>
. It might ask you for your password. - type the command
git remote -v
. You should now see links that contain bucs240 in them. If you don't see observe this change, please post on piazza.
- type the command
- Once you have updated the remote links, we need to perform a
git pull ...
once before moving to the next steps.- type the command
git pull origin master
. If it opens up an editor for you, just exit without making any changes.
- type the command
By now you should have successfully updated the remote links. To push the code to the newly repository, follow the below steps.
- First commit any changes by running the following commands in sequence.
git add --all
git commit -m "adding <lab2 or lab3> code to new repository."
git push origin master
You should be all set now. Navigate to the GitHub page and you should see your code there.
Last week each of you individually forked program1-template repository, added your partner as a collaborator started working on program1. Once you have created a team GitHub, you should have a repository created for you for program1.
If you haven't created/joined a team for program1, click here.
To push current code for program1 to the new repository, follow the below steps. Let's say that the directory you were earlier working in is called old-dir.
- Create a separate directory called program1.
- Change working directory to program1 using the command
cd program1
. - Clone the new repository using the available by clicking on the Clone or download button on the GitHub landing page. This would create a directory called program-1-spr19-<team>.
- Change working directory to program-1-spr19- using the command
cd program-1-spr19-<team>
. - Copy over all the files from old-dir (except driver code and README.md) over to current directory.
- Use the below commands to add, commit and push code to the new repository for program1.
git add --all
git commit -m "added all source files from old repository."
git push origin master
You should be all set now. Make sure that both you and your partner have cloned from new repository by checking that the result of git remote -v
for you and your partner is the same.
Good Luck!!