0

I have created a git repository using git fast import. I want to update committer information of a single file in it. How to update the committer info of the single file?

tRuEsAtM
  • 3,517
  • 6
  • 43
  • 83
  • You've already created your repository, so I would suggest following some of the steps in [this SO question](http://stackoverflow.com/q/179123/1426891), particularly those relating to `git filter-branch`. Remember, because committer information is only contained within a commit and every commit refers to its parent, rewriting a single file will actually require much of the commit history to be rewritten. (Unless: Are you considering reimporting the whole tree from your source repo, starting over but with granular source information from the beginning?) – Jeff Bowman Jul 07 '15 at 17:59
  • Actually I am trying to import metadata from Serena Dimensions version control system to Git. I tried Git fast-import by using dummy author name in the script. Now I want to update the commit history with actual author name. – tRuEsAtM Jul 07 '15 at 21:07

1 Answers1

1

Remember that each change in git depends on the previous commit, which depends on the previous commit, and so forth. Making one author/committer change early in your history will cause every commit hash from that point forward to change.

If making an author/committer change to an existing repository, you could use git filter-branch or a variety of other options to adjust the commit in question and all commits that come after it. You'd need to do so with coordination to everyone else using the repository, because any existing work they're doing would need to be adjusted to point only to your new (rewritten) commits, not to the commits from before the rewrite.

Because of the degree of rewriting involved, and because your repository is so new, I'd recommend re-importing paying attention to the "author" and "committer" lines on the git fast-import commit documentation.

Community
  • 1
  • 1
Jeff Bowman
  • 90,959
  • 16
  • 217
  • 251