-
Create own GitHub-Repository
-
Search for foreign GitHub-Repository and fork it within GitHub
-
git clone own GitHub-Repository which was created with the fork action in GitHub
$ git clone https://github.com/USERNAME/REPONAME.git
$ cd REPONAME
- Create and add connection to foreign GitHub-Repository. Typically this is named as upstream. Your own GitHub-Repository is stored as orgin.
- Connect foreign GitHub-Repository with lokal git project
$ git remote add upstream https://github.com/ANDERER_USER/ORIGINALREPO.git
# Check remote connections
$ git remote -v
- To pull data from the foreign repo add tracking info git branch -u The command -u is the same as --track
# Create remote connections for pull
$ git branch -u upstream/master
# Check remote connections
$ git branch --all
# Checkout remote
$ git fetch upstream
$ git pull
#Alternativ: $ git merge
- Make your changes and add it to your GitHub-Repository
$ git add file
$ git commit -m "message"
$ git push origin main
- Create an PR within Github to transfer changes to the foreign GitHub-Repository
- Waiting for approval and merge in the foreign repository
- Fetch and merge changes back to your repoistory