Is there a way to temporarily save something in the middle of a git management development (half done to commit)?
Now I have no choice but to make a commitment with the comment "Middle".
Situations include when you're away from work for a while or when you want to resume work on another PC.
git
patch.
Add Work
git add.
Save
git diff>>patchfile
The rest is
patch-p1<patchfile
stashSave your work temporarily
Add Work
git add.
Save
git stash
Add a message
git stash save 'message'
You can view a list of saved states.
git stash list
Back to the previous task
git stash apply
Save your work temporarily with patch.
Add Work
git add.
Save
git diff>>patchfile
The rest is
patch-p1<patchfile
stash temporarily saves your work
Add Work
git add.
Save
git stash
Add a message
git stash save 'message'
You can view a list of saved states.
git stash list
Back to the previous task
git stash apply
wip
and other commit messages, and if you want to use them on other terminals, push them (to the working branch).
In particular, even if it is completed only locally, I have recently used commit instead of stash.The reason is that if you accidentally drop the stash, basically you can't recover it anymore, but if you commit, you'll still have a reflog and you can recover from it.
Qiita article Stop doing this for Git! List "No.3: Don't commit and push for now", why don't you create a branch for that and commit and push it?
I found a tool called git-now when I looked into something similar before, so I'm using it.
You can create temporary commits with git now
and git now rebase
put together temporary commits with rebase-i
.
What I'm doing is the same as making a temporary commit, so if you want to push, I think it's better to make a special branch before doing it.
© 2024 OneMinuteCode. All rights reserved.