![]() # Wait until the rebase operation is completed # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # along with this script if not, write to the # You should have received a copy of the GNU General Public License # GNU General Public License for more details. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # but WITHOUT ANY WARRANTY without even the implied warranty of # This script is distributed in the hope that it will be useful, # under the terms of the GNU General Public License as published by # This script is free software you can redistribute it and/or modify it # - Windows: `C:\Program Files\Git\usr\bin` # Place this file in the following folder: # Git Rebase Branch Names, Tags, and Forks Though I believe Windows gives executable permissions for files by default? (Don't quote me on that) #! /bin/sh. ![]() Or on Windows icacls path/to/git-rebase-bti /grant your_usrnm:(rx) (without a file extension), and make it executable chmod x path/to/git-rebase-bti Or C:\Program Files\Git\usr\bin # On Windows USE AT YOUR OWN RISK! Place this either in /usr/bin/ # On Linux Here is a (relatively) simple bash script that will update branch names and tags. This gets you most of the way, but still requires manual adjustment of branch names, so that the point to the new-and-improved commits. Git 2.18 learned a new -rebase-merges option that lets you reconstruct certain histories by not only automatically copying individual commits, but also repeating merge operations (merge commits cannot be copied so the merges must be re-performed instead). So, if you have some history you don't like, you can build new history-new commits-that you do like, but having made even a single-bit change to some past commit, the new-and-improved commit has a different hash ID, and this change ripples down through the rest of the commits. The history is the set of commits: no more and no less. It's commit H itself that causes commit G to be part of branch branch, and then it's commit G itself that causes commit F to be part of the branch, and so on, backwards through history. The last commit of branch branch is commit H. Whatever hash ID is stored in the branch name, that commit is the last commit of that branch. There's really just one big thing to know about branch names like master and develop-almost everything else flows from this one big thing-and that is that each one just holds one commit hash ID. Then we will also need to copy H to a new and improved H' so that its parent can be G'. Where H is the "last" commit in the sequence, if we've copied F to a new and improved F', we'll need a new-and-improved G where the improvement, or at least one of them, is that the parent of G' is F'. These, put together, mean that you can always copy a commit to a new and improved version, but having done so, you must now copy every "downstream" (subsequent) commit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |