Created
September 16, 2020 18:38
-
-
Save Jimut123/9c521a61fc1a54585a3e9565c7cd68d6 to your computer and use it in GitHub Desktop.
Git Basics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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