2

Is it possible to upload local images to a GitHub repository web application directly?

I tried the first answer here (Uploading new files to a git repository directly through the github web application) with the "Create a new file here" answer... but I am unable to upload my locally-saved .jpg file.

I also tried to upload a file of the local .jpg images using command line doing commands like:

git add Pictures/*
git commit -m "Comment"
git push -u origin master

But I get errors (which I have Googled and failed at trying their suggestions), and as I am not comfortable with command-line, I wanted to know if there was a way to directly upload these locally-saved images to the GitHub web application GUI.

Thank you.

Community
  • 1
  • 1
  • 1
    What are the error messages? – VonC Feb 10 '14 at 07:14
  • 1
    i would suggest you to get comfortable with command line if you going to use git much more and it will also helpful in your future programming life. –  Feb 10 '14 at 07:21
  • One error message: ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/****/****.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. –  Feb 10 '14 at 07:56
  • Another error message: remote: error: failed to lock refs/heads/master To https://github.com/****/****.git ! [remote rejected] master -> master (failed to lock) error: failed to push some refs to 'https://github.com/****/****.git' –  Feb 10 '14 at 07:57
  • I had been using RStudio to update a .rmd file in the repository. I used the RStudio GUI to save, commit, and push. However, the push would not work, unless I did it command-line. Now that I am not working a .rmd file in RStudio (rather a locally-saved image), I am no longer able to use command-line to push, or I get the erros above. So I was looking for whether or not there is a GUI on the GitHub web interface itself that I could upload directly to. –  Feb 10 '14 at 07:59

1 Answers1

2

Apparently your local branch may be out of sync with your tracking branch.

Depending on project rules and your workflow you might also want to use

git pull --rebase.
Abhijit Gaikwad
  • 3,072
  • 28
  • 37