How to add my current project to an already existing GitHub repository

后端 未结 6 1022
南笙
南笙 2021-01-29 23:01

I\'m very new to Git. I\'ve been searching for an answer, but I couldn\'t find one.

In my computer I have a project folder like this:

project_a
--some_fo         


        
6条回答
  •  再見小時候
    2021-01-29 23:36

    I had more luck with navigating in my terminal to the directory I wanted to add to the repository, then (assuming you're working on a branch called master):

        git init
        git add .
        git commit -m "my commit"
        git remote add origin 
        git push origin master
    

    Here's a link to an article explaining how to do it in more detail: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

    Note that you won't be able to run the "git add ." line if the directory in question is open.

提交回复
热议问题