DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Understanding Git
  • The Art of the Bug Fix: Boosting Software Quality Through Effective Git Commits
  • Five Software Development Trends
  • How To Use Git Cherry-Pick to Apply Selected Commits

Trending

  • AWS vs. Azure vs. Google Cloud: Comparing the Top Cloud Providers
  • Logging to Infinity and Beyond: How To Find the Hidden Value of Your Logs
  • How to Migrate Vector Data from PostgreSQL to MyScale
  • Creating a Custom Starter With Spring Boot 3
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Changing the Author Name for a Git or Gerrit Commit

Changing the Author Name for a Git or Gerrit Commit

How to get around a failed commit due to a merge with remote repository and local code changes.

Pradeeban Kathiravelu user avatar by
Pradeeban Kathiravelu
·
Dec. 09, 15 · Tutorial
Like (3)
Save
Tweet
Share
3.75K Views

Join the DZone community and get the full member experience.

Join For Free

So this was my second time having some adventure with gerrit for OpenDaylight (also read about the first time, if you are curious). This time, I pulled the remote changes and tried to commit my new changes by adding my changes. This created a merge as the commit from the remote repository and my local commits merged in a single pull request, and hence my commit failed with the below message.

$ git review

You are about to submit multiple commits. This is expected if you are
submitting a commit that is dependent on one or more in-review
commits. Otherwise you should consider squashing your changes into one
commit before submitting.

The outstanding commits are:

fe17631 (HEAD, master) Fix bug 4535/4541
475fae6 Use odlparent-lite as artifacts parent

Do you really want to submit the above commits?
Type 'yes' to confirm, other to cancel: yes
remote: Processing changes: refs: 1, done    
To ssh://pradeeban@git.opendaylight.org:29418/messaging4transport.git
 ! [remote rejected] HEAD -> refs/publish/master/bug/4535 (you are not allowed to upload merges)
error: failed to push some refs to 'ssh://pradeeban@git.opendaylight.org:29418/messaging4transport.git'


Now,

$ git statusOn branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean

So it indeed shows as 2 commits - one mine, and the one pulled from the remote repository.

I had to rebase to the master to fix this.

$  git rebase origin/master

However, this left my commit attributed to the author of the previous commit, in the commit log when I try to git review.

I had to amend the author to finally fix the commit message successfully git review following that.

$ git commit --amend --author "FirstName LastName"


Commit (data management) Git Gerrit (software)

Published at DZone with permission of Pradeeban Kathiravelu, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Understanding Git
  • The Art of the Bug Fix: Boosting Software Quality Through Effective Git Commits
  • Five Software Development Trends
  • How To Use Git Cherry-Pick to Apply Selected Commits

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: