![]() Obviously this presumes you do the steps in one flow, if you stash at any other point in these steps you'll need to note the stash ref for each step above (rather than just basic stash and apply the most recent stash). With step 5 as you already applied the stash and committed the code you did want in step 4, the diff and untracked in the newly applied stash is just the code you removed in step 3 before you committed in step 4.Īs such step 6 is a stash of the code you didn't commit, as you probably don't really want to lose those changes right? So the new stash from step 6 can now be committed to this or any other branch by doing git stash apply on the correct branch and committing. Then if you want the code you removed (bits you didn't commit) in a separate commit or another branch, then while still on this branch do: 5. To just change the commit message of the last commit (even for a merge commit or if the working copy is not clean), invoke LocalEdit Last Commit Message. commit the remaining files/code you do want remove the files/code you don't want to commitĤ. ![]() I already found a workaround by pushing each repo to an empty repo added to a local Gitea server, then just deleting the local repo and cloning it back to local.This is a simple approach if you don't have much code changes: 1. ![]() It displays the repo contents OK anyway, and I can continue from there filling in missing commit messages, do some more cleanup etc., but I didn't look further yet so who knows what it will eventually break? The reason for this: my Git command line client isn't bothered by this, but my GUI (SmartGit for Windows) keeps nagging that it doesn't support replace commits (it detected refs/replace-refs it says). Once you are happy with the changes, select Save. the authors name and e-mail, the date written, and the commit message. develop ), but sometimes there is a need for further release branches (e.g. git log commit ca82a6dff817ec66f44342007202690a93763949 Author: Scott Chacon. Standard window: Support Multiple Main-Branches Usually, there is one main development branch (e.g. And even then, that would only add information in the revision message, without changing the actual author. To edit a commits message, simply open the commit context menu and select Edit Commit Edit Commit Message You can now begin typing a new commit message in the Details section. However, if you have set the Amend checkbox manually, it will not be unset when editing the commit message. Effectively, you are creating a new commit that replaces the old one. Changing the commit message will change the commit ID-i.e., the SHA1 checksum that names the commit. In Git, the text of the commit message is part of the commit. ![]() ![]() I however turned up empty handed when googling for how to do this. Unless you can make SmartGit use the options -add-author-from and -use-log-author on its internal git svn dcommit ( options illustrated in here ), that would not be supported. You can change the most recent commit message using the git commit -amend command. This can be automated by registering a hook, but it's a manual operation that has to be done for each new repository. And preferably via a script since I've got lots of repos with lots of commits. Gerrit: Generate Change-Id automatically in commit message david michonneau 6 years ago updated by Thomas Singer 6 years ago 0 When pushing to gerrit, a change-id is required in the commit message. Once the repo restructuring is done I'd like to get rid of all these replace commits again to really bake in the changed history. (note: they're all solo repositories only I work in, so no history altering disclaimers are needed, I know the caveats :) )įilter-repo works beautifully (with the Python scripting capabilities plus it's much faster than filter-branch), but it creates replace commits. For this I'm also using git filter-repo, to get rid of unwanted files and do some standard renaming via scripts. You can use this to change the commit messages, too. I'm busy converting all my existing SVN repositories to Git, and at the same time also take the opportunity to use Git's ability to easily rewrite some history. For SmartGit 17.1 there is a work-around: the Log contains the 'Rebase Interactive From' command in the immediate history of the current branch. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |