gge-ucd / Discussion

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

fatal git-commit error #33

Closed emilybrodie closed 6 years ago

emilybrodie commented 6 years ago

Hi all,

When I try to commit my script file from this weeks homework I get a message saying

"***Please tell me who you are."

"fatal: unable to auto-detect email address (got emilybrodie@Emilys-Air.(none))"

I am working within the project that I cloned from Github with my ucd email, so I'm not sure where the disconnect is happening.

Thanks for any help! Emily

ryanpeek commented 6 years ago

Hi @emilybrodie. Be sure to use the "@[a_git_user_name]" if you want to tag Michael, Taylor, myself or others directly (and potentially get a quicker response). I get an email letting me know someone posted something.

Good question. We were planning on trying to go over this in class (so tagging @gge-ucd/ents everyone here) as I suspect there are a few other folks encountering this issue. When we were setting up git, one of the things we wanted to have everyone check/set is your "global" username and email. It's a way for git to recognize you each time you try to push/pull from a repository. The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information. Typically you only need to do this once, so hopefully if you try the following this issue will get get sorted out.

Are you on a windows or Mac operating system? This should work for either, but there may be a few small things that need tweaking. Let me know.

  1. Open up RStudio and your github project. From there, hopefully you can select Tools > Terminal > New Terminal
  2. That should pop open a new window next to your Console. In the Terminal, try the following at the prompt that starts with "$": Type in git config --global user.name "Sunny Day", but replace with your name. This doesn't need to match your github username.
  3. Do the same thing but using the github email you log in with using this command: git config --global user.email studentname@ucdavis.edu (This does need to match exactly with your github email).
  4. To double check your global settings, you can use the following (in the Terminal): git config -l, which will print out a bunch of other stuff, but should have your username and email set correctly.

Again, you need to do this only once if you pass the --global option, because then Git will always use that information for anything you do on that system. If you want to override this with a different name or email address for specific projects, you can run the command without the --global option when you’re in that project, but that's not something we'll really be dealing with this quarter (though if you have issues with the --global, please try it without!...might be a windows permissions issue).

Hope this helps, good luck 👍

emilybrodie commented 6 years ago

Hi @ryanpeek! This was definitely the issue and after following the above instructions I was able to push my code. Thank you!

I'm not sure how I missed this part the first time, or how I was able to push and pull without any issues the first two weeks -- mysterious mysteries...