![]() ![]() In my previous post, I described how you can use the -autosquash option of Git rebase to automatically rearrange your commits when performing an interactive rebase. In this section I describe when it's useful. It's a port of Facebook's hg absorb tool. Git-absorb is a "plugin" for Git that can automatically create fixup! commits for use with git rebase -i -autosquash. I wasn't aware of the git-absorb tool at all, so in this post I look at what it does, how to install it, and how to configure it! What does git-absorb do? This is a follow on to my previous post on using -autosquash, in response to a comment mentioning it. Git is the source code version control system that is rapidly becoming the standard for open source projects.In this post I look at the git-absorb tool for automatically creating fixup! commits. It has a powerful distributed model which allows advanced users to do tricky things with branches, and rewriting history. What a pity that it’s so hard to learn, has such an unpleasant command line interface, and treats its users with such utter contempt. The information model is complicated – and you need to know all of it. As a point of reference, consider Subversion: you have files, a working directory, a repository, versions, branches, and tags. That’s pretty much everything you need to know. ![]() In fact, branches are tags, and files you already know about, so you really need to learn three new things. Now Git: you have files, a working tree, an index, a local repository, a remote repository, remotes (pointers to remote repositories), commits, treeishes (pointers to commits), branches, a stash… and you need to know all of it. The command line syntax is completely arbitrary and inconsistent. Some “shortcuts” are graced with top level commands: “git pull” is exactly equivalent to “git fetch” followed by “git merge”. But the shortcut for “git branch” combined with “git checkout”? “git checkout -b”. Specifying filenames completely changes the semantics of some commands (“git commit” ignores local, unstaged changes in foo.txt “git commit foo.txt” doesn’t). The various options of “git reset” do completely different things. ![]() The most spectacular example of this is the command “git am”, which as far as I can tell, is something Linus hacked up and forced into the main codebase to solve a problem he was having one night. It combines email reading with patch applying, and thus uses a different patch syntax (specifically, one with email headers at the top). The man pages are one almighty “fuck you”. Git-push – Update remote refs along with associated objects They describe the commands from the perspective of a computer scientist, not a user. Git-rebase – Forward-port local commits to the updated upstream head Here’s a description for humans: git-push – Upload changes from your local repository into a remote repository #Change commit message smartgit update#
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |