Question

I have created my project repository on git. Its a web development project. I want to upload a file to it.

For other kind of files (.txt, .php, .html, etc.) I know I can create a new file by clicking on + button and then copying my file's content there.

How can I upload an image to the specific directory (./img in my case). I have searched a lot but didn't got any suitable answer.

Was it helpful?

Solution

You can use this method if You are a beginner. You can add files using git add, example git add README, git add /*, or even git add *

Then use git commit -m "" to commit files

Finally git push -u origin master to push files.

When you make modifications run git status which gives you the list of files modified, add them using git add * for everything or you can specify each file individually, then git commit -m and finally, git push -u origin master

Example - say you created a file README, running git status gives you

$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   README

Source :: How do I add files and folders into github repos?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top