-
Notifications
You must be signed in to change notification settings - Fork 133
Resolving merge conflicts
What is a merge conflict?
Merge conflicts occur when competing changes are made to the same line of a file, or when one person edits a file and another person deletes the same file. A merge can enter a conflicted state at two separate points. When starting and during a merge process.
Solving merge conflicts
The only correct way to solve conflicts is to pull new changes, create a new commit and push again. Multiple ways to do this depending on how you use git: through command line, VS code, some GUI etc.
- Pull the changes from the main repo to your forked repo
- Check for changes (VS code also provides a prompt to resolve the conflict)
- After solving the conflict, save and push the changes
- Ask for review by reaching out on discord or twitter.
To sync the Main repository and your Own repository from the Terminal, follow the steps below:
Remember to follow the below steps you must have Git Bash installed on your system.
Open VSCode & open Terminal as Bash in VSCode OR Open Git Bash directly in your local Repository & write the following code
- Point to the main repo and pull from it. Create a new remote in local for pointing the main repo.
git remote add upstream https://github.com/twindle-co/twindle.git
- To download all the changes and commits from main Repository to your local Repository.
git fetch upstream
- The current branch will be updated to reflect the merge.
git merge upstream/main
- Push the changes to own repository on Github.
git push origin main
(Alternative for step 2 & step 3)
git pull upstream main
Now your Own Repository & Main repository are in sync.
Note:- If you want to add some more information, open a new issue