I'm trying to setup my git root folder to simply commit all changes to github when I git add .
then git commit -m "a simple message"
and git push
. The problem is that I've somehow made my gatsby folder into a submodule and I can't seem to remove that and revert back to the gatsby folder just being a part of the root folder that needs to be committed. Here's my most recent Terminal activity:
ericphifer@Erics-MacBook-Pro WestWater % git add .
ericphifer@Erics-MacBook-Pro WestWater % git commit -m "update files and folders to align between github and vscode"
On branch main
Your branch is up to date with 'origin/main'.
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)
(commit or discard the untracked or modified content in submodules)
modified: gatsby-ww (modified content, untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
ericphifer@Erics-MacBook-Pro WestWater % mv WestWater westwaterco
mv: rename WestWater to westwaterco: No such file or directory
ericphifer@Erics-MacBook-Pro WestWater % git rev-parse --show-toplevel #print repo top-level directory
/Users/ericphifer/Desktop/WestWater
#print
fatal: ambiguous argument '#print': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ericphifer@Erics-MacBook-Pro WestWater % git status
On branch main
Your branch is up to date with 'origin/main'.
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)
(commit or discard the untracked or modified content in submodules)
modified: gatsby-ww (modified content, untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
ericphifer@Erics-MacBook-Pro WestWater % git commit -a
On branch main
Your branch is up to date with 'origin/main'.
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)
(commit or discard the untracked or modified content in submodules)
modified: gatsby-ww (modified content, untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
ericphifer@Erics-MacBook-Pro WestWater % git conig --list
git: 'conig' is not a git command. See 'git --help'.
The most similar command is
config
ericphifer@Erics-MacBook-Pro WestWater % git config --list
credential.helper=osxkeychain
push.default=current
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/EricPhifer/westwaterco
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
submodule.gatsby-ww.url=https://github.com/EricPhifer/westwaterco.git
submodule.gatsby-ww.active=true
ericphifer@Erics-MacBook-Pro WestWater % git submodule deinit
fatal: Use '--all' if you really want to deinitialize all submodules
ericphifer@Erics-MacBook-Pro WestWater % git submodule deinit --all
ericphifer@Erics-MacBook-Pro WestWater % git config --list
credential.helper=osxkeychain
push.default=current
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/EricPhifer/westwaterco
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
submodule.gatsby-ww.url=https://github.com/EricPhifer/westwaterco.git
submodule.gatsby-ww.active=true
ericphifer@Erics-MacBook-Pro WestWater % rm -rf submodule.gatsby-ww.url=https://github.com/EricPhifer/westwaterco.git
ericphifer@Erics-MacBook-Pro WestWater % git config --list
credential.helper=osxkeychain
push.default=current
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/EricPhifer/westwaterco
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
submodule.gatsby-ww.url=https://github.com/EricPhifer/westwaterco.git
submodule.gatsby-ww.active=true
ericphifer@Erics-MacBook-Pro WestWater % rm -rf .git/modules/a/submodule
ericphifer@Erics-MacBook-Pro WestWater % git rm -f a/submodule
fatal: pathspec 'a/submodule' did not match any files
ericphifer@Erics-MacBook-Pro WestWater % git config --list
credential.helper=osxkeychain
push.default=current
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/EricPhifer/westwaterco
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
submodule.gatsby-ww.url=https://github.com/EricPhifer/westwaterco.git
submodule.gatsby-ww.active=true
ericphifer@Erics-MacBook-Pro WestWater % mv submodule.gatsby-ww submodule.gatsby-ww-temp
mv: rename submodule.gatsby-ww to submodule.gatsby-ww-temp: No such file or directory
ericphifer@Erics-MacBook-Pro WestWater % mv gatsby-ww gatsby-ww-temp
ericphifer@Erics-MacBook-Pro WestWater % git submodule deinit -f -- gatsby-ww
ericphifer@Erics-MacBook-Pro WestWater % rm -rf .git/modules/gatsby-ww
ericphifer@Erics-MacBook-Pro WestWater % git rm -f gatsby-ww
rm 'gatsby-ww'
ericphifer@Erics-MacBook-Pro WestWater % git config --list
credential.helper=osxkeychain
push.default=current
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/EricPhifer/westwaterco
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
submodule.gatsby-ww.url=https://github.com/EricPhifer/westwaterco.git
submodule.gatsby-ww.active=true
ericphifer@Erics-MacBook-Pro WestWater % mv gatsby-ww-temp gatsby-ww
ericphifer@Erics-MacBook-Pro WestWater % git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: gatsby-ww
Untracked files:
(use "git add <file>..." to include in what will be committed)
gatsby-ww/
ericphifer@Erics-MacBook-Pro WestWater % git add .
warning: adding embedded git repository: gatsby-ww
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> gatsby-ww
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached gatsby-ww
hint:
hint: See "git help submodule" for more information.
ericphifer@Erics-MacBook-Pro WestWater % git commit -m "add gatsby-ww for commits"
On branch main
Your branch is up to date with 'origin/main'.
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)
(commit or discard the untracked or modified content in submodules)
modified: gatsby-ww (modified content, untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
ericphifer@Erics-MacBook-Pro WestWater %
Much of this one is attempting to follow the directions of this thread How do I remove a submodule?, but you can see that every time I check the git config --list
the submodule is always still there. This is one of many stackoverflow threads I've tried to follow and nothing is working, so this is my last ditch effort to understand what's wrong and how to fix it. Git is so frustrating for me, please help and thank you.
Just checked another project and it's having the same issue except that it doesn't have a submodule for the gatsby file:
ericphifer@Erics-MacBook-Pro Joseph Center Code % git config --list
credential.helper=osxkeychain
push.default=current
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/EricPhifer/joseph-center.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.main.remote=origin
branch.main.merge=refs/heads/main
ericphifer@Erics-MacBook-Pro Joseph Center Code % git status
On branch main
Your branch is up to date with 'origin/main'.
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)
(commit or discard the untracked or modified content in submodules)
modified: gatsby-jc (modified content)
no changes added to commit (use "git add" and/or "git commit -a")