主持人注意:鉴于此问题已经发布了67个答案(其中一些已删除),请考虑在发布另一个问题之前是否提供任何新内容.
git pull和之间有什么区别git fetch?
我正在使用Git.我从一个远程仓库做了拉,并得到一条错误信息:
"请输入一条提交消息来解释为什么这种合并是必要的,特别是如果它将更新的上游合并到一个主题分支中."
我尝试输入一条消息并按下Enter但没有任何反应.
我怎么告诉Git /终端我输入了我的消息?
我在OS X上使用终端.
我创建了一个远程仓库,然后在本地创建了一个本地仓库:
git init
Run Code Online (Sandbox Code Playgroud)
然后添加的文件,我需要用git add那么git commit -m "something"
最后 git push origin master
我得到了致命的错误消息:
'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我应该在某些命令或某些内容中喜欢远程和本地吗?如果可以,是否已经添加并提交,还是应该从本地重新开始?
编辑:
显然我应该添加,git remote add origin ssh://git@example.com:1234/myRepo.git
但是我应该用什么替换该ssh,如在哪里可以找到我应该添加的版本。
得到这个错误:
! [rejected] master -> master (fetch first)
error: failed to push some refs to
hint: Updates were rejected because the remote contains work that …Run Code Online (Sandbox Code Playgroud) 我被这段代码困住了。在 git fetch 之后,我遇到了困难,不知道下一步应该做什么才能将所有提交的文件发送到 GitHub 服务器 - 现在只有一个文件 README.md 是在保存新存储库时自动创建的。感谢帮助。
Freeware Sys@DESKTOP-VK97GA5 MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git status
On branch master
nothing to commit, working tree clean
Freeware Sys@DESKTOP-VK97GA5 MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git remote add origin https://github.com/adambugaj/Lets-code.git
Freeware Sys@DESKTOP-VK97GA5 MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git push -u origin master
To https://github.com/adambugaj/Lets-code.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/adambugaj/Lets-code.git'
hint: Updates were rejected because the remote contains work that you …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过命令行上的 git 将我的 django 文件和文件夹推送到我的 git 存储库
我推送文件所采取的步骤是:
git初始化
git add --全部
git commit -m“我的消息”
git 远程添加源(远程 url)
最后
git Push -u 原始主机
然后我得到这个错误:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/E-wave112/myadmissionportalsite2.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git …Run Code Online (Sandbox Code Playgroud)