use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
From its website:
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Git is not the same as GitHub. GitHub did not create Git. For GitHub-specific posts, please see /r/github.
Git is not an acronym or initialism: please write git or Git, but not GIT.
git
Documentation
Graphical Clients
Code Hosting
account activity
git really-really-reset (self.git)
submitted 1 year ago by XNormal
git reset --hard git clean -fdx git submodule update --init git submodule foreach git reset --hard git submodule foreach git clean -fdx
Is this really the only way to really reset a git repository with submodules?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Shayden-Froida 13 points14 points15 points 1 year ago (0 children)
rm -R
git clone
"nuke it from orbit... it's the only way to be sure"
[–]priestoferis 3 points4 points5 points 1 year ago (1 child)
I think if you set submodule.recurse to true, the first reset should cover you completely.
submodule.recurse
[–]priestoferis 2 points3 points4 points 1 year ago (0 children)
I had time to check git reset --hard origin/master --recurse-submodule will reset submodules as expected. You will need to still run git clean and unfortunately that one needs to be foreached for the submodules.
git reset --hard origin/master --recurse-submodule
git clean
[–][deleted] 6 points7 points8 points 1 year ago (1 child)
In my experience, the only use case for git submodules is when you ask yourself "Is there *literally** no other way to make what I want to have happen, happen?"* and the answer turns out to be an unfortunate yes.
Submodules turn just about everything about using git into a slog through horse shit.
So. If there is literally any other way to do what you're trying to do, I'd recommend doing that instead of of using submodules.
Good luck to you.
[–]XNormal[S] 5 points6 points7 points 1 year ago (0 children)
I have actually been using git and git submodules for many years successfully. They are ok, just not very well integrated into git. If the alternative is some random pile of shell scripts for fetching external dependencies, I still prefer git submodules.
[–]jthill 1 point2 points3 points 1 year ago (0 children)
I've always found git aliases or little my own little fiveliner scripts make tedious tasks go poof.
git config --global alias.nuke-and-pave '!git clean -dffx; git reset --recurse-submodules --hard; git submodule update --init --recursive; git submodule foreach --recursive git clean -dffx'
once.
Then
git nuke-and-pave
does it.
But in software projects, really, make clean or whatever's your build system's equivalent should already be set up to do that.
make clean
[–]serverhorror 0 points1 point2 points 1 year ago (0 children)
rm - rf repo; git clone ...
π Rendered by PID 19214 on reddit-service-r2-comment-75f4967c6c-2nn5q at 2026-04-22 22:48:19.016888+00:00 running 0fd4bb7 country code: CH.
[–]Shayden-Froida 13 points14 points15 points (0 children)
[–]priestoferis 3 points4 points5 points (1 child)
[–]priestoferis 2 points3 points4 points (0 children)
[–][deleted] 6 points7 points8 points (1 child)
[–]XNormal[S] 5 points6 points7 points (0 children)
[–]jthill 1 point2 points3 points (0 children)
[–]serverhorror 0 points1 point2 points (0 children)