HPCE / hpce-2016-cw5

0 stars 2 forks source link

Empty repositories with auto_run results in #13

Closed m8pple closed 7 years ago

m8pple commented 7 years ago

There were a lot of empty repositories when I did the first run - possibly people are working just in one repo out of the pair, or are working locally.

If you want to do an initial push, and you find there is already something in the repository from the auto-run, then you should pull to get the changes, commit to merge, then push back up.

For example:

dt10@GABBY /cygdrive/e/tmp/hpce-2016-cw5-tmp
$ git remote -v
origin  git@github.com:HPCE/hpce-2016-cw5.git (fetch)
origin  git@github.com:HPCE/hpce-2016-cw5.git (push)

dt10@GABBY /cygdrive/e/tmp/hpce-2016-cw5-tmp
$ git remote rm origin

dt10@GABBY /cygdrive/e/tmp/hpce-2016-cw5-tmp
$ git remote add origin git@github.com:HPCE/hpce-2016-cw5-tmp.git

dt10@GABBY /cygdrive/e/tmp/hpce-2016-cw5-tmp
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

dt10@GABBY /cygdrive/e/tmp/hpce-2016-cw5-tmp
$ git push --set-upstream origin master
To git@github.com:HPCE/hpce-2016-cw5-tmp.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:HPCE/hpce-2016-cw5-tmp.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.

In order to solve it, pull the changes, then push:

$ git pull origin master
From github.com:HPCE/hpce-2016-cw5-tmp
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 README.md | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 README.md

dt10@GABBY /cygdrive/e/tmp/hpce-2016-cw5-tmp
$ git push --set-upstream origin master
Counting objects: 66, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (52/52), done.
Writing objects: 100% (66/66), 53.50 KiB | 0 bytes/s, done.
Total 66 (delta 11), reused 62 (delta 9)
remote: Resolving deltas: 100% (11/11), done.
To git@github.com:HPCE/hpce-2016-cw5-tmp.git
   ee3a275..ad50c89  master -> master
Branch master set up to track remote branch master from origin.