In any case if it is believed that the way it currently behaves in Wappler is correct then I think we are better of to remove the rollback uncommitted files function altogether as in my view partial rollbacks are worse than no rollback. This means that the commit will be reversed and additionally, the changes made to the files will also be discarded. The -hard flag indicates that git reset command will reset the HEAD, the index and the working tree. I really love the simplicity of Wappler and the way it allows us to do things in 1 application, but using GIT in Wappler for some things, and having to use a 3rd part GIT application for other functions defeats the purpose in my view. In this case, you need to do a hard reset. The way I use this often is to start with a clean GIT commit, then play around learning new things in current project and when I have figured it out I will roll back ALL uncommitted changes back to my known commit state. I guess in essence these new files are not in GIT yet so really donât see why they shouldnât be deleted when the user has selected them to be deleted? Iâve used this command for years, but Iâve never really understood why it uses git. This instruction is found in the output from running 'git status'. This behaviour is disorienting and confusing to an end user as without knowing the âhow it is supposed to workâ causes trust concerns as to what is rolled back and what is not, hence why I started using GitKraken for this function.įrom what I gather it is also different behaviour to the way GIT intended it to be used, at least when I look at how GitKraken does it, but by no means am I a GIT expert. When youâre using git and you want to discard your local changes to a file, this is how git recommends you do it: use 'git checkout - .' to discard changes in working directory.If the file is in the Changes section, right-click it and choose Undo Changes to discard all changes to the file since the last. Unstaged files show up in the Changes section. If the file is in the Staged Changes section, right-click it and choose Unstage. Then through GIT (refer to my screenshot in earlier post) on delete the routes file is rolled back, but the new file remains in place effectively orphaned until a new route is created? In the Git Changes window, identify the file with the changes that you want to discard. The second command shows you the hash of what is actually in your working directory. The first command will show you the hash of what would be committed. Look at this situation in a nodejs project: lets say a new file is added, the routes file is updated to reflect the new route. To see if this is the case, run the following commands: git hash-object path/to/filename git hash-object -no-filter path/to/filename git ls-files -s path/to/filename. ![]() This makes your local repository exactly match the state of the origin (other than untracked files). ![]() For example: git reset -hard origin/master. If youre really serious, you can discard all local commits and all local edits by doing: git reset -hard origin/branchname. I think the way it currently stands is confusing, and incorrect. All the answers so far retain local commits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |