Great observations, thanks Jenny.
- Manual rename Code.Rproj to FarallonInstitute.Rproj in the hope that aligning names makes it magically work: FAIL.
- FI/ vs FI/code: shouldn't be a problem I don't think: the code files themselves are in FI/Code, now with new Rproj name; the online location is SimonDedman/FarallonInstitute. This won't be a problem if Rstudio/git/github is ok with files being in a folder with one name, the project being a second name, and the github being a third, e.g. foldername/Code.Rproj -> github/user/ThirdName.git so long as the Code.Rproj's config file url line is pointing to the right place i.e. github/user/ThirdName.git. I've since changed the project name to match the github one but the config file is the same i.e. correct.
- Dropbox hasn't caused any problems so far with a separate project but you may be right in future!
Back to 1: I realised that changing the filename from Code.Rproj to FarallonInstitute.Rproj hasn't changed the name of the project from Code. It transpires Rstudio/git really does use the folder name that the Rproj file and .git folder etc are in as the project name. Changed folder name to FarallonInstitute, reopened RStudio, loaded Rproj, project name is now FarallonInstitute. Made a change, committed, but push option greyed out. This at least is progress.
Googled it, this (can't post links) says try "git push -u origin master" from shell then restart Rstudio. Tried in git bash in FI/FI folder, result:
$ git push -u origin master
To https://github.com/SimonDedman/FarallonInstitute.git
! rejected master -> master (fetch first)
error: failed to push some refs to 'https://github.com/SimonDedman/FarallonInstitute.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.
git pull origin master
From https://github.com/SimonDedman/FarallonInstitute
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
git push -f origin master
Counting objects: 24, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (24/24), 5.77 KiB | 1.44 MiB/s, done.
Total 24 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8), done.
To GitHub - SimonDedman/FarallonInstitute: Farallon Institute work scripts
- 10b33bd...d332c94 master -> master (forced update)
Seemed to work. Restarted github, made minor edit, commit fine, push still greyed out.
git push -u origin master
Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 416 bytes | 416.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/SimonDedman/FarallonInstitute.git
d332c94..5ab6f00 master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Restart github, nothing to commit, push no longer grey, pushed:
>>> C:/Program Files/Git/bin/git.exe push origin refs/heads/master
Everything up-to-date
WORKED, hooray! Wow what a lot of work for something seemingly so simple. Can't help feeling there must be a better way to have Rstudio/git/github work together but hey ho, sorted now and thus probably for the next year!
Cheers