If the problem is “main and master are entirely different commit histories.”, the following will work
git checkout master
git branch main master -f
git checkout main
git push origin main -f
More Related Contents:
- ‘git diff’ doesn’t show enough
- Trying to understand `git diff` and `git mv` rename detection mechanism
- Git push requires username and password
- What is the difference between origin and upstream on GitHub?
- Pull new updates from original GitHub repository into forked GitHub repository
- Updating a local repository with changes from a GitHub repository
- How to git-cherry-pick only changes to certain files?
- Link to the issue number on GitHub within a commit message
- What is the best practice for dealing with passwords in git repositories?
- git ahead/behind info between master and branch?
- GitHub “fatal: remote origin already exists”
- How to remove sensitive data from a file in github history
- Github remote push pack size exceeded
- Git’s famous “ERROR: Permission to .git denied to user”
- Jenkins – how to build a specific branch
- Search code inside a Github project
- Git push hangs when pushing to Github?
- Error when “git push” to github
- Delete local Git branches after deleting them on the remote repo
- Copy a git repo without history
- Remove directory from remote repository after adding them to .gitignore
- GitHub – fatal: could not read Username for ‘https://github.com’: No such file or directory
- In Jenkins, how to checkout a project into a specific directory (using GIT)
- Why are connections to GitHub over SSH throwing an error “Warning: Remote Host Identification Has Changed”?
- Understanding the basics of Git and GitHub [closed]
- Change date of git tag (or GitHub Release based on it)
- Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
- “Cannot spawn ssh” when connecting to Github, but ssh -T [email protected] works?
- Pushing a large github repo fails with “unable to push to unqualified destination: master”
- npm install package from github repo subfolder