jesseduffield / jesseduffield/lazygit
Some sort of sandbox mode
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Is your feature request related to a problem? Please describe.**
Often I'm to lazy to learn new git features in a separate repo and i'm to scared to use them in a production repo so in the end i usually just stick to the things i already know.
But there are just times when you just need to use them and usually that means i just make a copy of the folder i'm working in and start messing around in that folder.
Lazygit makes these features a lot more accessible and a lot less scary but I'm often still to scared to try them out when I'm messing around in a branch that has for example 1 month of work inside of it.
I know that most git features are reversible but that's not where my brain is once i realize i just "removed" a month of work with a git command i understand for 50%.
**Describe the solution you'd like**
Something like: `lazygit try`
1. It copies the current working dir to `../.{working-dir-name}-lazygit-try` (might be worth showing a short message what this command does and ask if they want to continue)
2. Opens the preferred shell in that folder
3. When lazygit is opened inside this shell it can detect it is in "Try" state and adds some extra functionality like:
- reset everything (panic button)
- commit the changes made in the try dir to the original dir and quit
- disable git features like pushing
4. When the shell is quit the lazygit that spawned the shell can ask the user for what they want like:
- if want to destroy all changes
- keep the changes made in the try dir
- show the executed git commands
**Describe alternatives you've considered**
Learning git features in a repo meant for that or just manually copying a production repo to another folder and tryout things in there.
**Additional context**
It's really just an ultra safe way of experimenting with git features in production repos without the fear of breaking things and with tools to keep the bar low like with one push of a button all files go back to the point where the user typed out `lazygit try` or when exiting everything should by default always revert back to before the `lazygit try`.
Because it spawns a fully interactive shell from `lazygit try` we could add a dir to the `$PATH` with some proxy binaries like `git` so we can check for things like `git push` and show a message before executing `git push` to ask the user if they are sure what they are doing and what the consequences of this could be
Contributor guide
Assessment
This issue has not been assessed yet.