Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git create new remote oupstream

# 1) Clone the repo
git clone <repo>

# 2) Set a new remote. The original is called origin, we shall call it "upstream"
git remote add upstream https://github.com/<...>.git

# 3) Fetch it
git fetch upstream

# 4) Create a new branch:
git checkout -b MyBranch

# 5) Follow new remote, the main branch (for git version > 1.8
git branch -u upstream/main

# Note: to push:
git push upstream HEAD
 
PREVIOUS NEXT
Tagged: #git #create #remote #oupstream
ADD COMMENT
Topic
Name
7+8 =