search

Home  >  Q&A  >  body text

How to add local projects to git management?

1. I already have a project locally.
2. Halfway through development, I want to use git to manage this project.
3. Then I created a new project on github
4. So how do I associate the local project with the newly created git?
The way I know now is to use git clone to download the empty project, and then copy the previous project over, git add and then commit push

The problem is: I don’t want to move or change the file name of the original project
PS: The environment I am currently using is CentOS 7

Thank you in advance~

迷茫迷茫2852 days ago640

reply all(3)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:32:41

    1. git init

    2. git add .

    3. git commit -m “init”

    4. git remote add origin your github warehouse address

    5. git push

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:32:41

    Execute git init in the directory where your original project is located to create a git project and then synchronize it to the remote server

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-02 09:32:41

    Create an empty resource library on github,
    Build a git environment locally, and submit it to the address of your resource library.
    More Baidu, there are many resources
    Attachment:
    http://www.linuxidc.com/Linux/ 2015-08/121007.htm

    reply
    0
  • Cancelreply