Skip to content

Instantly share code, notes, and snippets.

@Jimut123
Created September 16, 2020 18:38
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 Jimut123/9c521a61fc1a54585a3e9565c7cd68d6 to your computer and use it in GitHub Desktop.
Save Jimut123/9c521a61fc1a54585a3e9565c7cd68d6 to your computer and use it in GitHub Desktop.
Git Basics
# To fetch the upstream from an outdated fork or to update a fork
# https://garygregory.wordpress.com/2016/11/10/how-to-catch-up-my-git-fork-to-master/
$ git fetch upstream
$ git remote add upstream https://github.com/pytorch/tutorials or <the url of the upstream>
$ git remote -v # check if the things are okay or not
$ git checkout master
$ git merge upstream/master
# To create a PR
# https://opensource.com/article/19/7/create-pull-request-github
# fork it
$ git checkout -b new_branch
$ git remote add upstream https://github.com/kedark3/demo # add the upstream URL link
$ git checkout -b new_branch
$ echo “some test file” > test # add changes
$ git status
$ git add test # add the files
$ git commit -S -m "Adding a test file to new_branch"
$ git push -u origin new_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment