Reputation: 13182
I want to push to github. I am using SourceTree.
When I push, I get an error like this:
How can I solve this problem?
The graph on SourceTree is like this:
If I pull, it displays an error too like this:
Upvotes: 0
Views: 250
Reputation: 2665
In your screen shot you can see 3 commits, two commits are connected, test and remove test, but then your newest commit does not have a parent, hence no related histories.
origin/master
has no useful code)Judging by the commit messages, you have an empty repo before your latest commit. In this situation, I would force replace what is on remote by doing git push -f
.
Please note this will delete the commits labeled test
and remove test
.
origin/master
)Use git cherry-pick
those commits into your local master. Always do this oldest to newest.
git cherry-pick <commit hash>
Upvotes: 1