7

I have installed Git exe for windows at my machine. I have also created my account at github.com. My requirement is simple- How do I upload my project say one folder and two files in it to github.com.

Rocky Singh
  • 13,980
  • 28
  • 91
  • 142
  • Related posts - [How to upload a project to Github](https://stackoverflow.com/q/12799719/465053) & [Is it possible to create a remote repo on GitHub from the CLI without opening browser?](https://stackoverflow.com/q/2423777/465053) – RBT Jan 07 '19 at 01:19
  • Does this answer your question? [How to upload a project to Github](https://stackoverflow.com/questions/12799719/how-to-upload-a-project-to-github) – Suraj Rao Aug 29 '20 at 09:00

2 Answers2

11

first follow these steps to create an ssh key: http://help.github.com/win-set-up-git/

then create a local repository on your computer and push it to github with these instructions: http://help.github.com/create-a-repo/

rgngl
  • 4,901
  • 2
  • 28
  • 34
0

Go to github.com and on the top right press the "+" button and choose new repository. Give it a name and adjust the settings you want and press create repository. After doing so, you should be redirected to a page containing some commands, which means you have been doing everything right until now.

Open your git and go to the folder you want. For example, if the folder's name is "Demo", use the command "cd Demo". After that, type

git init

to create a new git repository. Then use

git add <the name of the file or folder>

What this does is it adds the chosen file to the staging area, telling git to keep track of that file. After doing so, make a commit by simply writing

git commit -m "(what you want to say)" 

After that type in this command:

git remote add origin https://github.com/<username>/Demo.git. 

Change the < username > to your username and the Demo.git to the name you gave your repository. Last but not least, use this command:

git push -u origin master. 

Now if you search up www.github.com/< yourusername >/ < the name you gave your repository > you would go to the page that contains your published work.

image

Suraj Rao
  • 28,186
  • 10
  • 88
  • 94