git remote -v code example
Example 1: git match remote master
git fetch origin
git reset --hard origin/master
Example 2: set up git repository
# New local repository
git init
git add .
git commit -m "Initial commit"
# New remote repository
# Create remote repository (likely on github), then:
git remote add origin https:
git remote add origin git@github.com:username/new_repo #ssh
# Now push
git push -u origin master
Example 3: git remote
git remote #This has two part "origin" and "upstream"
# Adding origin
git remote add origin <The url of local github repository>
#Adding upstream
git remote add upstream <The url where you have forked repository>
Example 4: git remote
git remote add origin <repository url> # adds a repo to your project
git remote # lists all the repos of your project
git config --get remote.origin.url # prints the url of a repo
git push origin master # updates the master branch of your repo
git remote remove origin # removes the repo from your project
Example 5: git bash upstream branch change
git branch --set-upstream-to=origin/branch
Example 6: pull down remote branch git
git fetch origin
git checkout --track origin/<branch_name>