码迷,mamicode.com
首页 > 其他好文 > 详细

git failed to push some refs to

时间:2019-07-18 19:28:18      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:apr   nta   osi   stream   des   netty   use   rom   lin   

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=nettyGuide/<branch> master


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git push nettyGuide
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 nettyGuide master


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git push --set-upstream nettyGuide master

To https://gitee.com/ghostsugar/nettyGuide.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to https://gitee.com/ghostsugar/nettyGuide.git
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., git pull ...) before pushing again.
hint: See the Note about fast-forwards in git push --help for details.

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=nettyGuide/<branch> master


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git pull nettyGuide master
warning: no common commits
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From https://gitee.com/ghostsugar/nettyGuide
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> nettyGuide/master
fatal: refusing to merge unrelated histories

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git commit
On branch master
nothing to commit, working tree clean

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git push nettyGuide
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 nettyGuide master


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ ^C

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$   git push --set-upstream nettyGuide master
To https://gitee.com/ghostsugar/nettyGuide.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to https://gitee.com/ghostsugar/nettyGuide.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.

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=nettyGuide/<branch> master


Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$ git pull nettyGuide master
From https://gitee.com/ghostsugar/nettyGuide
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)
$   git push --set-upstream nettyGuide master
To https://gitee.com/ghostsugar/nettyGuide.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to https://gitee.com/ghostsugar/nettyGuide.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.

Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master)

出现错误的主要原因是github中的README.md文件不在本地代码目录中,可以通过如下命令进行代码合并【注:pull=fetch+merge]
$ git pull
--rebase nettyGuide master From https://gitee.com/ghostsugar/nettyGuide * branch master -> FETCH_HEAD First, rewinding head to replay your work on top of it... Applying: io Administrator@AB-201903201424 MINGW64 /d/IdeaProject/github/netty-guide (master) $ git push -u nettyGuide master Enumerating objects: 23, done. Counting objects: 100% (23/23), done. Delta compression using up to 4 threads Compressing objects: 100% (15/15), done. Writing objects: 100% (22/22), 5.69 KiB | 1.90 MiB/s, done. Total 22 (delta 3), reused 0 (delta 0) remote: Powered By Gitee.com To https://gitee.com/ghostsugar/nettyGuide.git f3be308..8939350 master -> master Branch master set up to track remote branch master from nettyGuide.

 

git failed to push some refs to

标签:apr   nta   osi   stream   des   netty   use   rom   lin   

原文地址:https://www.cnblogs.com/meijsuger/p/11209406.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!