Push existing project into Github

后端 未结 18 889
天涯浪人
天涯浪人 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:02

    I know, this is an old question but I'm trying to explain every step, so it may help others. This is how I add an existing source to git:

    1. Create the repo on the git, so you'll have the ssh || https where you're gonna remote add you source code.
    2. In your terminal go to the path of your project.
    3. Run git init (here you initiate the project as a git one).
    4. Run git add * (here you add all the files and folders from you project).
    5. Run git commit -m "Initial Commit." (here you commit your files and folders added in step #4; keep in mention that you can't push your changes without committing them).
    6. Run git remote add origin https://your_username@bitbucket.org/your_username/project-name.git (here you add a remote project where your source it's gonna be pushed; replace my link with your ssh || https from the step #1).
    7. Run git push -u origin master (here you push your source into the git repository).

    Note: Those are simple steps for pushing your source into the master branch.

提交回复
热议问题