Hello,
I have a local branch which has been pushed to remote branch already.
After pushing to remote, I had to change the commit message. Therefore I used interactive rebase to change the commit message in my local branch. When trying to push this new commit message, the remote seems to be detached from my local head ie. I can not see my local branch name in the Push dialog box.
I used the terminal to force push and ended up with this fatal message:
fatal: '<branch_name>' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I would appreciate if someone could share their experience in a similar situation.
I would like to know how I can push my local branch(with changed commit message) into the remote branch.
Thanks in advance!
!!Solved!!
This situation cannot be solved from the Sourcetree Gui unfortunately. The correct terminal command would be:
git push origin <local_branch_name>:<remote_branch_name> -f
if the local_branch_name = remote_branch_name
git push origin head -f
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.