【发布时间】:2021-10-14 14:14:19
【问题描述】:
我尝试使用以下命令推送我的项目,包括 Vue 代码。
git remote add origin <repository_url>
git add *
git commit -m "your commit message"
git push -u origin master
但是我位于vue-passport 文件夹中的所有vue 代码都被忽略了。所以,我无法将 vue 代码推送到 Github。仅供参考:我正在使用 vue-cli 与 Laravel 一起构建我的 vue 项目。
当我使用以下命令时:
git add .
git commit -m "first commit"
or
git status
它会产生错误:
On branch master
Changes were not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in the working directory)
(commit or discard the untracked or modified content in submodules)
modified: vue-passport (modified content, untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
这是我在vue-passport 文件夹中的.gitignore
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
这是我在 Laravel 中的 .gitignore 文件。
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
【问题讨论】:
-
你能在这里粘贴一个“git status”输出和你的“.gitignore”的内容吗?会有帮助的
-
尝试 git add . 代替 git add *