git
Submodule initialization failure
fatal: No url found for submodule path|Submodule.*registered for path.*not found
Fixes
- 1.Initialize submodules: `git submodule init && git submodule update --recursive`
- 2.Re-clone with submodules: `git clone --recurse-submodules <url>`
- 3.If URL changed, update .gitmodules then run `git submodule sync && git submodule update --init`
submodulesinitclone
Related Errors
git3 fixes
Merge conflict
CONFLICT \(content\): Merge conflict in (.+)
- •Open conflicted files, resolve the <<<<<<< / ======= / >>>>>>> markers, then `git add` and `git commit`
- •Use a merge tool: `git mergetool` (configure with `git config merge.tool <tool>`)
git3 fixes
Detached HEAD state
You are in 'detached HEAD' state
- •Create a branch to keep your work: `git checkout -b my-branch`
- •Return to a branch: `git checkout main` (commits in detached HEAD may be lost without a branch)
git3 fixes
Push rejected — remote has new commits
\! \[rejected\].*\(fetch first\)|failed to push some refs.*Updates were rejected
- •Pull and rebase: `git pull --rebase origin <branch>` then push again
- •Pull and merge: `git pull origin <branch>` then resolve conflicts and push