On the Select Components step, Cygwin users will probably want to clear the checkbox next to Associate.You may change the destination folder if you want.If you are using a version newer than 1.7.6, please comment on this wiki document or post a new topic to the Forge development forum. Download the latest Git-X.Y.Z-preview executable from the msysgit project.(Braids did not uninstall the Cygwin version, and has had no trouble. Run or download setup.exe from the Cygwin web site to do so. If you use Cygwin, and you have installed Git for that, you supposedly need to uninstall it.SmartGit, a graphical client, requires that regular (command line) Git be installed on your system first. Install SmartGit Install command-line Git I would consider it beta quality at this time. It is ready for limited use by those comfortable installing software. In vim you can be at any point of the tree, but in emacs you're always at the end.This document is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. While vim's model is an actual tree and undos are movements in it, emacs's is a ring and undos are inserted changes at the end of the ring. It's just different models of undo that avoid any loss of state. This can get confusing quickly without the visual display of the tree, but it's just a matter of hitting C-/ enough times to get to where I wanted to be.ĮDIT 2: Now that I think about it, C-/ is not equivalent to g-, but it's the closest thing. Then, if I wanted to get back to "foo" again, I'd have to undo the undo of the undo of the insert with C-/, and then undo the undo of the undo of the undo with C-/. If I wanted to move back to "bar" after the undos that I did, I'd have to undo the undo of the undo with C-/, and undo the undo of the insert with C-/. Emacs C-/ is actually equivalent to vim's g- and not the u command.ĮDIT: I wish emacs had something like vim's g+ to move forward in that history. There is the gundo plugin to display a nice tree to navigate, but you can navigate it on stock vim with g- and g+. You can insert "foo", undo the insert with C-/, insert "bar", undo the insert with C-/, and undo the undo with C-/ to get back to "foo". Undo-tree displays it nicely, but you can still navigate it on stock Emacs with C-/ alone. I've used it for years and recommend it highly. SmartGit is full of features like this where something cumbersome on the command line is straightforward and easy. Click the Stashes checkbox and they show up in the log too. After all, stashes are really just commits by another name. SmartGit shows the differences immediately. You can see immediately the parent of each reflog commit, and to see what you changed, just click one of them as you would any other commit in the log. In SmartGit, you simply click the Recyclable Commits checkbox in the Log view, and now everything in the reflog shows up in the log tree, just like any other commit. What if you have several commits with the same message, as will happen if you've rebased or amended any commits? If you're not sure which of those commits is the one you want, it's a fairly laborious process to dig through them. The Git command line reflog is just a list of hashes and messages. SmartGit has a brilliant implementation of the reflog. Usually git is enough to save me, but I've also had plenty of times where I make some mistake outside of git commit history and am saved by digging through local history. It automatically records changes as you make them so you can go back to previous versions of any file. JetBrains IDEs do this by default, and other editors have plugins for it. Supposedly-destructive operations like amend and rebase actually just build the tree at a different point and move branches to other places in the tree, but (pretty much) nothing in the tree is ever destroyed.įor the actually-destructive git commands like checkout and reset, another tool that I'd highly recommend is a "local history" feature in your editor. As long as code has ever made it into that tree (by being in any commit at any time), it's recoverable, and reflog lets you trace your steps back to any point in the past on that tree. It doesn't fix everything, but it works very well as long as you view git with the right mental model: a git repo is an ever-growing tree of immutable commits, with branches and tags pointing to the most interesting ones. I think the most powerful tool for fixing mistakes is "git reflog".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |