repo status
shows me a lot of un-wanted changes.
It would be duplicated if I enter every project and use git reset --hard
.
Is there a way to reset all the changes using repo, something like repo reset --hard
?
There are two Git commands a developer must use in order to discard all local changes in Git, remove all uncommited changes and revert their Git working tree back to the state it was in when the last commit took place. The commands to discard all local changes in Git are: git reset –hard. git clean -fxd.
Undo local changes by using git revert: Run the following command to check the current status of the repository. Run the following command to add the index. html file into the repository. Commit the task with the commit message and undo this change using the `git revert` command.
Try Git checkout --<file> to discard uncommitted changes to a file. Git reset --hard is for when you want to discard all uncommitted changes. Use Git reset --hard <commit id> to point the repo to a previous commit.
This is the command I use for this kind of things, very useful
repo forall -vc "git reset --hard"
What everything mean here ?
the repo forall
will execute for all repos.
the -v
is verbose, so it will print the output of the command
the -c "COMMAND TO EXECUTE"
is the actual command you want
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With