Closed iallum closed 4 years ago
Hmm, not sure why you are getting that message. It implies there are commits in your copy of the repository on GitHub that do not exist in your local copy.
Try pulling the repository first before pushing. We don't really use pulling in the usual workflow, but essentially this means pulling changes from GitHub down into your local copy. There is a button in RStudio right next to the push button that lets you do this.
Try pulling, then push again. If you get more error messages, post them here
tried to pull and got this message:
/usr/bin/git pull Auto-merging README.md CONFLICT (content): Merge conflict in README.md Automatic merge failed; fix conflicts and then commit the result.
Check your README.md
. There will probably be a couple of sections which look very odd, something like this:
If you have questions, please
<<<<<<< HEAD
open an issue
=======
ask your question in IRC.
>>>>>>> branch-a
You need to fix the text within those <>
brackets to be the version you want and delete the brackets. Essentially figure out what version of the document you want. Once you do that, stage/commit/push one more time. This should now allow you to push your changes to GitHub
it did let me push, but it committed a version with the bracketed section and both versions of the code, not one with the edits I made. and when I tried to push it again (thinking maybe I had accidentally committed and therefore pushed before editing), it just tells me everything is up to date even though it doesn't appear to be.
Did you stage/commit the saved file after you edited it?
yes i thought so -- I also don't see a README.md thing in the environment/history box anymore (I think there was one there before?)
I'm pretty sure this is the version of the document you want
---
output:
html_document: default
pdf_document: default
---
# hw01
### Self-Introduction
![](images/profile pic.png)
Hi! My name is **Izzy Allum**, and I am a first year at the University of Chicago. I'm from Washington, DC, so that's where I've been spending quaratine. My hobbies include:
* fencing (I'm on the club team at UChicago)
* baking and cooking
* listening to music
* listening to [Spotify](https://open.spotify.com/) and watching [Netflix](https://www.netflix.com/browse)
* occasionally doing some arts and crafsty stuff!
Copy this into your README and replace the original contents, save, stage, commit, and push (yes I know that sounds a bit tedious). That should fix the problem though.
thank you so much! one last question: when I preview the markdown on my own computer, the picture i added shows up, but when I look at it on github, it doesn't. is this supposed to happen or am I missing something (I figure I very well could be since I just googled how to add images and did a bit of trial and error)?
It's not converting the markdown to the necessary image output. Try adding blank lines before and after that line of text in the document.
You may also need to rename the file so it doesn't have a space in the name. Some computers don't like whitespace in file names
I tried doing both of those, and something changed because there is no longer a line of text there, but there still isn't a picture showing up on github.
I have the image in a folder in my hw01 folder, do I perhaps need to commit and push this image/folder to github?
Yes
Right now the version on the site has a good URL, but you haven't changed the file name of the image yet. So essentially the embedded image has a broken link
thank you so much! It's all working now.
I've been working on the hw assignment and I think I have it finished so I want to push it to git, however, RStudio isn't letting me do that. I've already committed and pushed a few times before, but all of a sudden it won't let me anymore. The error message says:
To https://github.com/iallum/hw01.git ! [rejected] HEAD -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/iallum/hw01.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I also have a notification above my environment/history pane that says: your branch is ahead of 'origin/master' by 2 commits