编辑:如果您使用 git bash,应该注意的一件事是最好保持 AUTOCRLF FALSE
git config --global core.autocrlf false
==================================================== ======
我是 git 新手,部署文件时遇到问题...
我刚刚使用命令成功提取了文件(?),现在我正在尝试推送...
下面的提交日志:(我有几次还原,因为由于 LF、CRLF 或未跟踪的文件错误,我多次提交失败)
在 AS 我得到“推送到原点/主服务器被拒绝”
推送时的错误
hint: Updates were rejected because the tip of your current branch is behind
! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
Done
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
18:53:20.176: [Lab1_movie] git -c core.quotepath=false -c
log.showSignature=false pull --progress --no-stat -v --progress origin
master
From https://github.com/kiranofans/Lab1_MovieApp
* branch master -> FETCH_HEAD
= [up to date] master -> origin/master
fatal: refusing to merge unrelated histories
18:57:26.215: [Lab1_movie] git -c core.quotepath=false -c
log.showSignature=false push --progress --porcelain origin
refs/heads/master:master
github --credentials get: github: command not found
github --credentials store: github: command not found
error: failed to push some refs to
'https://github.com/kiranofans/Lab1_MovieApp.git'
To https://github.com/kiranofans/Lab1_MovieApp.git
! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
Done
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.