4 ms·
Git itself seems to recommend these commands e.g. if I do "git status", and there are changed files, git says: Changes not staged for commit: (use "g
by arunix 4y ago
Git itself seems to recommend these commands e.g. if I do "git status", and there are changed files, git says:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
...
Another example where it recommends "switch"
git checkout f9b45dd
Note: switching to 'f9b45dd'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -