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 <name> <url>

and then push using the remote name

    git push <name>


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 <name> <url>

and then push using the remote name

    git push <name>


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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值