(Note: currently, if a stash doesn't apply because of conflicts, you can still apply it manually by opening the stash and then using "Compare with Working Tree." on the individual files to apply the changes. As long as the stash doesn't contain staged changes, this probably could be made to behave more like a cherry-pick. Currently it just gives up if there's any conflict. What could be improved in JGit's StashAppl圜ommand is probably the conflict handling. Unstash the previously created stash with A & B. Repeat until you're happy with the commit.Ĥ. If there are problems, edit C and amend the commit X. Now only A & B are changed with respect to the index or HEAD, nothing is staged.Ģ. Which is maybe not what you want at all if a file has both staged and unstaged changes.Īssuming you have distinct sets of files (A, B, and C are changed, but you want to stash A & B and commit only C), doesn't the following work:ġ. But note that such an operation would reset both the working tree _and the index_ to HEAD for these files. If we had the necessary support in JGit, we could provide a "create stash" command that takes as input the currently selected files. JGit currently has no support for "git stash push. I can provide screenshots or answer any questions if this is required. Often the conflict prevents the unstash entirely. This gets me in trouble because the stash contains all edits so if I edit further any of the files I wish to commit first, then when I unstash to get at the rest I get a conflict error. Then unstash them all again and Replace with HEAD Revision on all files I want to deal with later. To do this with EGit today, I need to stash all of my edits. Git locates them through the special name stash. These two, or three, commits are special in one important way: they are on no branch. The default is two you get three if you use any spelling of the -all or -include-untracked options. This leaves only my excluded changes behind, which I can move back to included and test/check-in them separately. As a bit of additional explanation, note that git stash makes either two commits, or three commits. You can choose to Shelve all changes in the included section with the option of undoing the changes as part of the shelve operation. It has a Pending Changes list with support for excluded changes (essentially the Unstaged Changes section of the Git Staging view). The TFS plug-in supports this capability, so I have been used to using it for many years. However, I want to be more certain that what I am about to commit passes local tests, so I would like to stash some of my edits and run verifications on what I am about to commit. At the moment, I can commit some of the edits using the Staged and Unstaged separation of the Git Staging view (very handy). It is typical to want to commit only some of these edits and save others for later exploration. When working towards a solution, I often end up with a number of edited files. Can the Stash Changes command add support for stashing only the files in the Staged (or Unstaged) section of the Git Staging view?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |