I'm trying to commit/Push some code to GIT, but when I tried to commit the code using SourceTree it gave me an error:
remote: Push rejected.[K
remote:
remote: refs/heads/Branch Details: 6a5d6d4cdd53db591e53db78c51225a619af487f: expected committer name 'Your Name Complete' but found 'Your Name'[K
remote:
Commit is done, but code is not pushed to remote.
I just noticed in the Global setting that my was "Your Name" and I changed it (TO: Your Name Complete) in Global configuration, also verified the name in Tools --> Options
and its showing "Your Name Complete" now.
I also tried:
git config --global user.name "Correct User Name"
git config --global user.email "[email protected]"
but still unable to Push the changes, still the same error can any one help me to push the code to remote repository?
The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.
Following the example of this blog post (it was for a tag, in your case it is for a branch HEAD), you would need to amend at least just the branch HEAD you want to push:
git commit --amend --allow-empty --author="LastName, FirstName <[email protected]>"
And then push.
I faced the same issue, reverting the changes, and then updating the git config and recommitting worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With