Closed megpritch closed 2 months ago
While this method is not ideal, it has always worked for me and kleiner in a pinch:
1) Commit your existing changes to a branch so that git doesn't complain at step 4 2) Delete .RData (as you've done) and/or 2) Check .RData is in your your .gitignore file as I've pushed up to the master here https://github.com/HARPgroup/HARParchive/blob/master/.gitignore (you may have already done this in the last meeting as well)
3) Copy the files that you've changed to somewhere safe outside of the GitHub folder structure, ex. Desktop. You only need to save the files that you are trying to push the changes for.
4) In git: git fetch origin master git checkout master git -c pull origin master
5) checkout a new branch 6) copy your files saved from your Desktop back into the git repository folder structure on your harddrive. 7) The usual: git add --all git commit -m "[your message]" git -c push origin [branchname]
Please note, this method only works if you have confidence in which files you changed. I think there's a trick to identifying those so if you're unsure, say so, and we can look for that tip.
@megpritch if you follow @gmahadwar suggestion I am sure this will work. Also, let's all make sure that we have .RData
in our .gitignore
file!
@gmahadwar @rburghol Thank you for your help--my updates are finally pushed to GitHub! I wouldn't merge anything just yet, but I'm hoping to have the modularized mapgen functional within the latest summaries script by later today.
Mapgen Modularize Update: Megan Remains at War with Git
I believe I have fixed the errors I was getting with mapping the labels in the new
fns_mapgen.R
, but I am still unable to push my progress to GitHub for others to see.Here's the type of error I keep getting:
And here is what I've tried:
1. Deleting the .RData file on my computer and trying to
git add -A
git commit -a -m
again2. Both of the commands from the Git Tips and tricks:
And again with a full file path:
I did the above commands for both of the large files that GitHub was unhappy with (i.e. for
HARP-2023-Summer/Mapping/.RData
as well). These commands would run for a long time and then ultimately would not work when I tried to push.Then I tried the other command:
and this gives the error:
3. Then I did some googling and tinkered with
git rebase
:Source: git rebase initial info Source: git rebase Source: git reset
The last 3 commits were all replicas of my failed 'modularize progress' commit attempts, so I did this:
I thought this
git reset
would only delete the problematic commits that were in transit to GitHub, and NOT my local edits, but I was wrong. I lost all of my most recent fixes, so I had to go back and re-implement them. Then, I made sure to delete any .RData files before trying to add/commit/push again, but I still received the same push error as before.Additionally,
I cannot test to make sure I re-implemented all of the edits I lost, because my REST login is now coming back unsuccessful. I made sure to re-update my
auth.private
with the most recent password, but this did not solve the issue.The Good News:
After using
git reset --soft HEAD~3
, the warning for the large .RData file in the/Functions
folder is gone: