gge-ucd / Discussion

Class discussion for R-DAVIS course
0 stars 4 forks source link

syncing with git when it isn't the computer you cloned the repo to? #50

Closed caparisek closed 5 years ago

caparisek commented 5 years ago

Low-priority issue but can we back-track to week 1 for a second...

I sometimes get to work between 2 computers. Most of my stuff is on Google Drive so it works out. In this narrative, computer1 I take to class; computer2 I do not. In R-DAVIS week 1, I installed all the same things on comp2 as comp1 after I got it all to work.

This weekend was my first time only having access to comp2 since I was away for the weekend. Since my R Projects folder is in Google Drive, I have no problem seeing my files etc. The trouble is, the whole "pull, commit, push" git options aren't there on computer2 and so for some reason, it doesn't know what git is even though I installed it. I re-installed it again today to check.

When I run: xcode-select --install (from happygitwithr(Mac)) in the console I get back "Error: object 'xcode' not found".

Or the long way:

git --version Error: object 'git' not found > git config Error: unexpected symbol in "git config"

It worked before, why doesn't it now? Is there a way to clone a repo when you aren't trying to create a repo? If there is, then that may be part of my issue - but how do I do that...

Ref material: https://gge-ucd.github.io/R-DAVIS/computer_setup.html https://happygitwithr.com/install-git.html

Thanks! @ryanpeek @MCMaurer @MarthaWohlfeil

MarthaZillig commented 5 years ago

Hey @caparisek

Are you attempting to do this all in the terminal in RStudio, and not the console? This needs to be done in-terminal. You also need to be using the "bash" language, which means that in the terminal a new line starts with a $. If a new line doesn't start with a $, let us know and we can walk you though how to change it!

ryanpeek commented 5 years ago

Hi @caparisek, @MarthaWohlfeil is spot on...it looks like you may be trying to enter those commands in your R console. We didn't spend much time on it, but Git actually runs in a separate sort of language/program, called "bash". Since you are on mac, it's pretty easy, you can either use your Terminal program directly, or open a terminal/shell window up through RStudio (see screen shots below). I would recommend going through RStudio and an RStudio project, because when opened, the folder or path (where you are) will default to the directory where your Rproject is.

screen shot 2019-02-07 at 5 22 40 pm

screen shot 2019-02-07 at 5 27 17 pm

Try walking through things and keep us posted. Good luck! ☘️

caparisek commented 5 years ago

Well, I feel silly. I forgot to switch to Terminal! It works now, thanks so much @MarthaWohlfeil and @ryanpeek.