我正在尝试将我的Laravel应用程序推送到GitHub。我所做的事情如Laravel app
目录中所示:
git init
git remote add origin my@gitrepositaty.com
git commit -u 'my app'
# nothing added to commit but untracked files present
git add .
# fatal: LF would be replaced by CRLF in .env.example
git add origin master
# error: src refspec master does not match any
答案 0 :(得分:2)
对于初学者来说,在将项目提交到存储库时,最好只提交所有文件,而只提交对项目重要的文件。
如果是laravel项目,你应该从laravel项目root directory开始
也就是说,为了将您的更改提交到git repo,您需要:
git add . # Stages your changes for next commit
git commit -m "YOUR COMMIT MSG HERE" # Commit those changes into the repo
git push # Pushes changes to your current branch (by default master)
# and your current remote (in this case origin after you did
# git remote add origin my@gitrepository.com
一般情况下,我建议您查看how a git repo works
答案 1 :(得分:1)
我修复的方法是在git.config文件中添加autocrlf = input,safecrlf = false
感谢您尝试帮助@ macareno.marco