Not able to push the next app to git
Answered
nikkuv posted this in #help-forum
nikkuvOP
I'm getting this error while pushing to the git repo.
The things I've tried so far =>
- deleted .next file
- added these large files to the gitignore
This is my gitignore file
The things I've tried so far =>
- deleted .next file
- added these large files to the gitignore
This is my gitignore file
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
/node_modules
node_modules
dist
dist-ssr
*.local
# next.js
/.next
.next
/node_modules/@next/swc-darwin-arm64/next-swc.darwin-arm64.node
node_modules/@next/swc-darwin-arm64/next-swc.darwin-arm64.node
# local env files
.env*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?Answered by joulev
basically what happened is: you somehow tracked node_modules in a previous commit and so gitignore had no effect. technically you could use the commands here https://stackoverflow.com/q/1274057, but when i checked your repo i see it's blank so i decided to tell you to just start from a clean slate instead.
19 Replies
(note: i'm telling you to get rid of the git history and start fresh)
nikkuvOP
is this the correct command to delete the .git file?
rm .gitit's a folder so
rm -rf .gitnice, looks good to me
is there one single
node_modules in your proejctor somehow there are many
node_modules?if there is one single
node_modules i think you're ready to gonow continue with adding remote with
git remote and do normal steps to push to githubgetting this now
https://github.com/nikkuv/currency-converter-usd-to-inr wait you already pushed?
nikkuvOP
got it...pushed my code to the branch, Thank you
Yeah 😛
nice
looks great, have fun coding
basically what happened is: you somehow tracked node_modules in a previous commit and so gitignore had no effect. technically you could use the commands here https://stackoverflow.com/q/1274057, but when i checked your repo i see it's blank so i decided to tell you to just start from a clean slate instead.
Answer