SimCenter Forum

SimCenter Training => Programming Bootcamp => Topic started by: adindar on August 14, 2020, 05:01:24 PM

Title: Forking a repository
Post by: adindar on August 14, 2020, 05:01:24 PM
Dear all,
I'd forked the Bootcamp repository and done "git clone https://github.com/ahmetanildindar/SimCenterBootcamp2020" to my computer prior the start of the classes. This happened last Friday.

I was late to the first hour yesterday and missed some topics on git.

Here is my question; is it possible to update my forked repository which is of course behind the current Simcenter and somehow sync with current Simcenter?

I hope I've expressed myself well.

++Ahmet
Title: Re: Forking a repository
Post by: asuselo on August 14, 2020, 05:56:22 PM
try this steps (from yesterday's slide):

Exercise – Lets Synch your FORK with SimCenter
1. Open terminal window/ Powershell
2. cd to SimCenterBootcamp2020 folder
3. Lets add and commit any changes (or checkout original) .. Type: git status
git add .
git commit –m “my great changes”
4. Lets look at remotes repos
git remote -v
5. Add NHERI-SimCenter/SimCenterBootcamp-2020 as upstream
git remote add upstream https://github.com/NHERI-SimCenter/SimCenterBootcamp2020.git
6. Look at remotes again
git remote -v
7. Lets fetch upstream
git fetch upstream
8. Use checkout to get last committed version
git merge upstream/master
9. Git add, commit and push to our own remote repo (origin)
git add .
git commit –m “fmk – updated code from merge”
git push origin master
10. Go to your browser, your remote repo (origin) should contain latest code
Title: Re: Forking a repository
Post by: adindar on August 15, 2020, 06:02:25 AM
Thanks, it worked for me.

Best regards.

++Ahmet
Title: Re: Forking a repository
Post by: joshmcquin on June 10, 2023, 09:12:40 AM
Thanks for the information guys