Create a new Git repository and add a local project

Create a new Git repository and add a local project

  1. Create a repository on your own GitHub.

    Create a new git repository

  2. Open the command line tool and switch to the project directory to be uploaded.

  3. Initialize the current directory as a Git repository.

    git init

  4. Add the files in the directory to the local repository.

    git add .Add all files in the current directory

    If you need to unstage a file, use the git reset HEAD <file>command

  5. Submit staged files

    git commit -m "initial commit"

  6. Copy the newly created repository address from GitHub.

    Copy the new warehouse address

  7. Add the address of the remote repository using the command line.

    git remote add origin https://github.com/theonegis/keras-examples.git

    git remote -vView remote warehouse address

  8. Push the local repository to the remote GitHub.

    git push -u origin master

    If the prompt conflict can be forced to push:git push -u origin master -f

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325693505&siteId=291194637