Skip to content

Instantly share code, notes, and snippets.

@nishanc
Last active October 7, 2018 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nishanc/d033ec6e0e1ae13eddd8553559b16d72 to your computer and use it in GitHub Desktop.
Save nishanc/d033ec6e0e1ae13eddd8553559b16d72 to your computer and use it in GitHub Desktop.
---------------------------------------------------Section 1---------------------------------------------------
//Add upstream url to original repository
git remote add upstream https://github.com/99xt-incubator/skype-notifier-bot.git
//Check if both origin and upstream urls are there
git remote -v
# This should give following outputs
# origin https://github.com/<username>/skype-notifier-bot (fetch)
# origin hhttps://github.com/<username>/skype-notifier-bot (push)
# upstram https://github.com/99xt-incubator/skype-notifier-bot.git (fetch)
# upstram https://github.com/99xt-incubator/skype-notifier-bot.git (push)
//Fetch latest changes/commits on the original repository
git fetch upstream dev
//See the changes/commits made on the original repository
git log --oneline --all --graph --decorate --branches
//Get latest commits to local repository of the forked repository
git pull upstream dev
---------------------------------------------------Section 2---------------------------------------------------
//Switch to local dev
git checkout dev
//Merge changes from upstream/dev to local dev
git merge upstream/dev
---------------------------------------------------Section 3---------------------------------------------------
//Remove remote url
git remote rm
//View remote urls
git remote -v
//Set remote url
git remote set-url upstream https://github.com/nishanc/ConstructionLK.git
---------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment