How to upload a project to Github

After checking this question I still have no idea how to get a project uploaded to my Git Hub repository.

I'm new to Git Hub and I have no idea what to do. I created a Repository but i want to upload my project to it.

I've looked on the repository page for an upload button of some kind but I haven't seen anything of the sort.

I've looked at the links provided so far but I'm still getting no where. They mention command line, is that Windows command line or Git Bash? Because I can't get either to do anything.

I also tried using Git GUI but when I select the folder I want it says that it's not a Git repository...does it need to be zipped up? I tried adding the .gitconfig file in the folder but it doesn't make a difference.

Thanks in advance :)


Since I wrote this answer, github released a native windows client which makes all the below steps redundant.

You can also use sourcetree to get both git and mercurial setup on Windows.


Here is how you would do it in Windows:

  • If you don't have git installed, see this article on how to set it up.
  • Open up a Windows command prompt.
  • Change into the directory where your source code is located in the command prompt.
  • First, create a new repository in this directory git init . This will say "Initialized empty git repository in ....git" ( ... is the path).
  • Now you need to tell git about your files by adding them to your repository. Do this with git add filename . If you want to add all your files, you can do git add .
  • Now that you have added your files and made your changes, you need to commit your changes so git can track them. Type git commit -m "adding files" . -m lets you add the commit message in line.
  • So far, the above steps is what you would do even if you were not using github. They are the normal steps to start a git repository. Remember that git is distributed (decentralized), means you don't need to have a "central server" (or even a network connection), to use git.

    Now you want to push the changes to your git repository hosted with github. To you this by telling git to add a remote location, and you do that with this command:

    git remote add origin https://github.com/yourusername/your-repo-name.git

    Once you have done that, git now knows about your remote repository. You can then tell it to push (which is "upload") your commited files:

    git push -u origin master


    如何从头开始将项目上传到Github

    Hi This will help you to upload a project to Github. Follow the instruction from Burhan Khalid above and Observe that if its upload of project from scratch then do git pull origin master before git push origin master

    SO if upload of project from scratch then:

    1) git init 2) git add. 3) git commmit -m "Add all my files" 4) git pull origin master 5) git push origin master


    Follow these two steps:

  • Create the repository online using the link: https://github.com/new
  • Then link your local repo to the remote repo using the command: git add remote origin https://github.com/userName/repo.git Here the repo.git will be your newly created remote repo.
  • This will work like a charm. No need to worry about the SSH or HTTPS ways. I first faced the same issue and spent hours for solution. But this worked for me.

    链接地址: http://www.djcxy.com/p/45232.html

    上一篇: 找不到存储库

    下一篇: 如何将项目上传到Github