An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
August 20, 2021 03:26 pm GMT
Original Link: https://dev.to/daw888/simple-work-with-git-fork-3cdj
Simple work with Git Fork
"A fork is a copy of a repository that you manage. Forks let you make changes to a project without affecting the original repository."
On the start
We have 2 repos
- original
github/OWNER/original
- forked
github/YOU/forked
In forked repo we can check our settings
$ git remote -v> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
On the next we need to add original repo as upstream
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
Now we should see
$ git remote -v> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)> upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)> upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
Get changes from original to forked
git fetch upstreamgit checkout maingit merge upstream/main
Creating Pull Request from forked to original
# FORKED repo# make changesgit add .git commit -m "message"git push
Then go to github and create Pull Request.
Workflow
To keep workflow clean:
original forked
forked original (do it only when you are sure what are you doing!)
Original Link: https://dev.to/daw888/simple-work-with-git-fork-3cdj
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To