I'm trying to push my changes on GitHub, but it throws an error Everytime I use "git push -u origin main"
The error:
* branch main -> FETCH_HEAD
Already up to date.
You are having merge conflicts, so you need to resolve them first. Basically someone in master
changed the same code as you did in your branch, so git
does not know what change to keep.
So you need to decide what change to keep: The change in master
(i.e. foo += 1
-> foo += 2
), the change in your branch (i.e. foo += 1
-> foo += 3
) or a combination of both (i.e. foo += 1
-> foo += 4
). There are a lot of tutorials on how to do that with git. Stackoverflow also contains many questions regarding solving merge conflicts in git, i.e. How to resolve merge conflicts in a Git repository?