У меня есть репо, в котором есть только один файл (файл блокнота Jupyter).Поскольку файл был создан с использованием Google Colab, он не существовал в моем локальном репо, а был только в моем репозитории GitHub.
Я только что добавил файл README и пытался перенести мой локальный репозиторий на GitHub.Но так как удаленное репо было впереди моего локального, я не смог толкнуть после совершения.
Затем я решил вытащить, но так как я не был знаком с синтаксисом, я не указал никаких параметров после git pull
.Затем я попытался снова с git pull origin master
, но теперь я получил сообщение об ошибке, в котором говорится, что есть ошибка, и имя репозитория изменилось на «master | MERGING» ... Я знаю, что мне, вероятно, нужно перенести пульт в новую локальную ветку иобъединить его с моей основной веткой, но я не знаю, как это сделать здесь, а также боюсь все испортить ... Спасибо за любые советы!
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git commit -m "Add README file"
[master 13c0b76] Add README file
1 file changed, 16 insertions(+)
create mode 100644 README.md
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git push origin master
To https://github.com/georgeliu1998/tf_and_colab.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/georgeliu1998/tf_and_cola b.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 pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git checkout master
Already on 'master'
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git pull
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 18 (delta 5), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (18/18), done.
From https://github.com/georgeliu1998/tf_and_colab
0a500ee..1238317 master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git push origin master
To https://github.com/georgeliu1998/tf_and_colab.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/georgeliu1998/tf_and_cola b.git'
hint: Updates were rejected because the tip of your current branch is behind
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.
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git remote
origin
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git pull origin
You asked to pull from the remote 'origin', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master)
$ git pull origin master
From https://github.com/georgeliu1998/tf_and_colab
* branch master -> FETCH_HEAD
hint: Waiting for your editor to close the file... warning: failed to restrict f ile handles (2)
handle #0: 0000000000000434 (type 3, handle info (1) 0
handle #1: 0000000000000438 (type 3, handle info (1) 1
This is a bug; please report it at
https://github.com/git-for-windows/git/issues/new
To suppress this warning, please set the environment variable
SUPPRESS_HANDLE_INHERITANCE_WARNING=1
error: cannot spawn C:/Users/georg/AppData/Local/atom/bin/atom.cmd: No such file or directory
error: unable to start editor 'C:/Users/georg/AppData/Local/atom/bin/atom.cmd'
Not committing merge; use 'git commit' to complete the merge.
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_col ab (master|MERGING)
$ git push origin master
To https://github.com/georgeliu1998/tf_and_colab.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/georgeliu1998/tf_and_colab.git'
hint: Updates were rejected because the tip of your current branch is behind
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.
georg@DESKTOP-9VE7F0E MINGW64 /d/Dropbox/WorkingDir/personal-projects/tf_and_colab (master|MERGING)
$