Home Git guide from fork to pr
Post
Cancel

Git guide from fork to pr

Git step by step guide

1. Clone Repository

  1. Go to origin repository and fork

  2. Go to [username]/[repository name]

  3. clone forked repository

    1
    
    git clone [fored repo address]
    
  4. set remote repository as upstream

    1
    
    git remote add upstream [original repo address]
    

2. [Recommend] Make and checkout new branch

1
git checkout -b [branch name]

3. How to PR

  1. Sync forked repository with original repository

  2. Go to origin repository and make pull request

  3. Delete local branch after pr is merged

    1
    
    git 
    

Appendix

How to sync fored repoitory With original repository

1
2
3
4
git checkout [main or master]
git fetch upstream
git rebase upstream/[branch you want to sync with]
git push origin [main or master]
1
2
3
4
5
git checkout [main or master]
git fetch upstream
git push
git stash save --keep-index
git stash drop
This post is licensed under CC BY 4.0 by the author.

Trending Tags