本地合并远程分支上的代码
git pull 远程仓库的url
提交:
git add .
git commit -m "信息"
提示错误
$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
解决方案:
git pull <url> 获取到的内容,第一次提交需要加上远程仓库的url
$ git add --all 或 git add . 或 git add file.js
$ git commit -m "提交信息"
$ git remote add origin '远程仓库url'
$ git push -u origin origin(对应远程分支名)
下一次可直接提交:
$ git add --all | git add . | git add file.js
$ git commit -m "信息"
警告
warning: LF will be replaced by CRLF in store/README.md.
The file will have its original line endings in your working directory
解决方案:
git rm -r --cached .
git config core.autocrlf false
git add .
git commit -m ''