Git push local project to remote gitee

Time:2020-2-18
  • Git global settings
    git config --global user.name "xxx"
    git config --global user.email "xxx"
  • Create git warehouse
    1) Enter project root
    git init
    Git push local project to remote gitee
    2) Add to local warehouse
    git add .
    Git push local project to remote gitee
    git commit -m "xxxx"Submission of information
    Git push local project to remote gitee
    3) Get the latest version from remote and merge to local
    git pull origin master
    Git push local project to remote gitee
    4) Commit local branch to remote branch
    Git remote add origin https://gitee.com/tahara/git -… Create a warehouse on git server
    Git push local project to remote gitee
    git push -u origin master
    Git push local project to remote gitee
  • In the process of submission, remember to pull the code first, otherwise it may be reported

    ! [rejected] master -> master (non-fast-forward)
    error: failed to push some refs to ‘https://gitee.com/tahara/git-…’
    hint: Updates were rejected because the tip of your current branch is behind
    hint: its remote counterpart. Integrate the remote changes (e.g.
    hint: ‘git pull …’) before pushing again.
    hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
    This problem occurs because the files in gitee are not in the local code directory. You can use the following command to merge the codes, and then submit
    git pull --rebase origin master
    Git push local project to remote gitee

  • If existing warehouse
    git remote add origin https://gitee.com/tahara/git-test.git
    git push -u origin master

Recommended Today

Laravel service container must know

The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t To learn how to build an application with laravel is not only to learn how to use different classes and components in the framework, but also to remember allartisanCommand or all helper functions (we have Google). Learning to code with laravel is […]