Git使用指南

刚开始在上传的时候有点分不清东南西北,仔细看看报错信息其实有给你提示,还有就是GitHub上写的明明白白的上传步骤,留意看看。

*clone项目在本地加载时,工具可能会报错:not found git.exe

解决办法:在系统命令框中输入path,查看系统环境变量配置是否配置.配置就好。

 

 


fatal: remote origin already exists.

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git branch --set-upstream-to=origin/master master
error: the requested upstream branch 'origin/master' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git remote rm origin

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git branch --set-upstream-to=origin/master master
error: the requested upstream branch 'origin/master' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git remote rm origin
fatal: No such remote: origin

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git branch --set-upstream-to=origin/master master
error: the requested upstream branch 'origin/master' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git checkout master
Already on 'master'

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git branch --set-upstream-to=origin/master master
error: the requested upstream branch 'origin/master' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git fetch

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git push -u
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository us                                                                                                                                                                                               ing

    git remote add

and then push using the remote name

    git push


lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git push git push
error: src refspec push does not match any.
error: failed to push some refs to 'git'

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository us  
                                                                                                                                                                                            ing

    git remote add

and then push using the remote name

    git push


lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git remote add ProjectName http://xxxxxxxxx.git

lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git push  ProjectName
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream ProjectName master


lenovo@DESKTOP-G04VK25 MINGW64 ~/Desktop/park (master)
$ git push --set-upstream ProjectName master
Enumerating objects: 1247, done.
Counting objects: 100% (1247/1247), done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1196/1196), done.
Writing objects: 100% (1247/1247), 91.41 MiB | 7.93 MiB/s, done.
Total 1247 (delta 258), reused 0 (delta 0)
remote: Resolving deltas: 100% (258/258), done.
To http://xxxxxxxxx/UserName/
ProjectName.git
 * [new branch]      master -> master

你可能感兴趣的:(Git使用指南)