Push existing project into Github

后端 未结 18 885
天涯浪人
天涯浪人 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 04:58

    I found that stimulating an update in "natural" sequence was an easier route than force-pushing things.

    Supposing that the repo is already created on github and you may have also put some stuff into the README.md .

    1. On your computer, open terminal and git clone [repo URL]

    2. You'll see a new folder will have been created bearing your repo's name. Feel free to rename it - doesn't matter.

    3. Move your code, files etc into this folder. Edit the README.md if you have to.

    4. Now open Terminal / command prompt, get inside that folder and do things as if you are making the next update to the repo:

    git add .
    git commit -m "v2"
    git push origin master
    

    Note: at the commit command git may reject, asking to configure the user email and password first. Follow the steps as given on screen, then run the commit command again.

    1. And those three commands is what you do now onwards for every time you want to push another update.

提交回复
热议问题