git reset HEAD^ --soft

git reset HEAD^ --hard

--soft 表示保留当前commit,重新commit
--hard 表示丢弃当前add,重新add、commit

Your branch is ahead of 'origin/master' by 1 commit.的更多相关文章

  1. Git报错:Your branch is ahead of 'origin/master' by 1 commit

    .    commit之后,用git status,打印信息为: # On branch master # Your branch is ahead of 'origin/master' by 1 c ...

  2. git status message - Your branch is ahead of origin/master by X commits

    git reset --hard origin/master git status FAQ: When I issue the "git status" command, I se ...

  3. Your branch is ahead of 'origin/master' by 21 commits.

    当切换到主分支后,准备 git pull 拉取远程 master 分支时,提示本地主分支显示有 21 个commits 问题原因: 因为你修改了 local master 本地的主分支,可以选择以下方 ...

  4. Git Your branch is ahead of 'origin/master' by X commits解决方法

    (1)方法1:git fetch origin (2)方法2(代码还需要):git push origin (3)方法3 (代码不需要):git reset --hard origin/$branch ...

  5. Your branch is ahead of 'origin/master' by 2 commits.

    遇到这种问题,表示在你之前已经有2个commit而没有push到远程分支上,所以需要先git push origin **将本地分支提到远程仓库.也可以直接git reset --hard HEAD~ ...

  6. git pull 然后 ahead of origin/master * commit 消失

    本来显示 your branch is ahead origin/master * commit后来也许在master merge 这个分支后, 然后git pull, 就显示Your branch ...

  7. it commit提示Your branch is up-to-date with 'origin/master'.

    今天提交git仓库的时候,遇到了如截图所示的问题,提示Your branch is up-to-date with 'origin/master'. 查了些资料后,发现其根本原因是版本分支的问题 这时 ...

  8. git push origin master出错:error: failed to push some refs to

    1.输入git push origin master 出错:error: failed to push some refs to 那是因为本地没有update到最新版本的项目(git上有README. ...

  9. 新建本地仓库,同步远程仓场景,出现git branch --set-upstream-to=origin/master master 解决方法

    1.本地创建一个本地仓库 2.关联远程端:git remote add origin git@github.com:用户名/远程库名.git3.同步远程仓库到本地git pull这个时候会报错If y ...

随机推荐

  1. c++之带默认形参值的函数

    先来个例子: #include <iostream> using namespace std; ,){ return x+y; } int main(){ //freopen(" ...

  2. Nginx源码完全注释(8)ngx_errno.c

    errno.h中的strerror(int errno)可以确定指定的errno的错误的提示信息.在 Nginx 中,将所有错误提示信息预先存储在一个数组里,而预先确定这个数组的大小,是在自动化脚本中 ...

  3. 144. Binary Tree Preorder Traversal (Tree, Stack)

    Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary t ...

  4. CloudStack 安装时需要的第三方包

    1.mysql-connector-java 2.jakarta-commons-daemon-jsvc 3.jsvc   rpm -ivh cloudstack-common-4.1.1-0.el6 ...

  5. js 数字游戏

    在某网站看到一道js题,觉得有点意思 Some numbers have funny properties. For example: 89 --> 8¹ + 9² = 89 * 1 695 - ...

  6. Openssl s_time命令

    一.简介 s_time是openss提供的SSL/TLS性能测试工具,用于测试SSL/TSL服务 二.语法 openssl s_time [-connect host:port] [-www page ...

  7. LIS和LCS LCIS

    首先介绍一下LIS和LCS的DP解法O(N^2) LCS:两个有序序列a和b,求他们公共子序列的最大长度 我们定义一个数组DP[i][j],表示的是a的前i项和b的前j项的最大公共子序列的长度,那么由 ...

  8. C# 基础连接已经关闭: 发送时发生错误

    在程序中获取某个https网址的源码,GetRespose()时 出现了“基础连接已经关闭: 发送时发生错误.”的错误提示. 翻了论坛后,有个仁兄说:                 //.net 4 ...

  9. Spring MVC @RequestMapping浅析

    简介:@RequestMappingRequestMapping是一个用来处理请求地址映射的注解,可用于类或方法上.用于类上,表示类中的所有响应请求的方法都是以该地址作为父路径.RequestMapp ...

  10. ORB_SLAM2_Android

    链接:https://github.com/FangGet/ORB_SLAM2_Android README.md 说明文件 This Project is out of date 该工程过时了 Th ...