hurlbertlab / core-transient

Data and code for NSF funded research on core vs transient species
7 stars 3 forks source link

git issue #59

Closed ssnell6 closed 8 years ago

ssnell6 commented 8 years ago

I'm working through dwork 279 and everything is going well in R, but I ran into an issue committing to git. I tried to do "git commit -am" but got the error that

scripts/R-scripts/data_cleaning_scripts/dwork_279_SJS.R scripts/R-scripts/data_cleaning_scripts/dwork_279_SJS_files/

were untracked. I thought I could fix it by tracking them with git add and git push but now I'm not recognizing the output (there's a lot of text after I committed the files) and I don't want to mess anything up.

I'm going to keep working in R and I'll wait to commit until I hear back.

Thanks!

ahhurlbert commented 8 years ago

Ok, I'm assuming this is the first time you tried committing changes to dwork_279_SJS.R?

The very first time a new file has been added to a repo, you will need to use git add and git commit as separate statements like this:

git add scripts/R-scripts/data_cleaning_scripts/dwork_279_SJS.R
git commit -m "adding cleaning script for d279, formatted dates (or whatever)"
git push origin master

From then on, now that the file is being tracked (it's not being tracked until you git add it), you can combine those first two steps like this (note the '-am' instead of '-m'):

git commit -am "formatted species names for d279"
git push origin master

So try the first one above and let me know if it works.

ssnell6 commented 8 years ago

This worked, thanks!

ssnell6 commented 8 years ago

I actually don't think it's working. I compared the gitbhub script to the one on my computer and it's not updating the script on github. The last edits were all 7 days ago. I'm not getting any errors in git. It says my raw data has been added, but I keep getting a detached head when I try to commit.

On Wed, Dec 30, 2015 at 3:00 PM, ahhurlbert notifications@github.com wrote:

Ok, I'm assuming this is the first time you tried committing changes to dwork_279_SJS.R?

The very first time a new file has been added to a repo, you will need to use git add and git commit as separate statements like this:

git add scripts/R-scripts/data_cleaning_scripts/dwork_279_SJS.R git commit -m "adding cleaning script for d279, formatted dates (or whatever)" git push origin master

From then on, now that the file is being tracked (it's not being tracked until you git add it), you can combine those first two steps like this (note the '-am' instead of '-m'):

git commit -am "formatted species names for d279" git push origin master

So try the first one above and let me know if it works.

— Reply to this email directly or view it on GitHub https://github.com/hurlbertlab/core-transient/issues/59#issuecomment-168064824 .

ahhurlbert commented 8 years ago

Check git status for both the core-transient repo and the core-transient/data subrepo and paste both sets of results here.