Push existing project into Github

后端 未结 18 968
天涯浪人
天涯浪人 2020-12-04 04:25

I have a folder with my project sources. How I can push this project into Github\'s repository?

I tried using this steps:

  1. I created empty repository o
18条回答
  •  无人及你
    2020-12-04 05:13

    If you're on a Mac (and this probably works the same on a PC), here's a very easy way to do this. Strangely enough I've looked high and low for this simple process and never found it.

    • Do not do anything on Github (other than having an account, and not having used up all your available repos).
    • Download GitHub for Mac and install. Go through the account setup, etc. Do NOT create any repositories for your existing project.
    • "Add New Local Repository" in repositories.
    • Select your existing folder. It'll ask if you want to do that, say yes.
    • Once done, you'll see a list of all your files, etc. Commit them.
    • Go to Repositories and Publish (this will create the new repo on GitHub for you, if you set up your account properly).
    • Go to Repositories and Push (you'll either see the "nothing to push" thing, or it'll push your files/changes to the newly-auto-made repo).
      • Wonder why you could not find this simple process anywhere else.

    I know it is not recommended to use the project folder as the repo folder. I do it all the time, it always works, it makes it simple, and I never have any trouble with it.

提交回复
热议问题