git提交文件命令顺序

  1. fetch
  2. merge
  3. add
  4. commit
  5. pull
  6. push

取消已add文件

git reset HEAD 文件名

覆盖本地文件

git checkout 文件名

$ git pull

error: You have not concluded your merge (MERGE_HEAD exists).

hint: Please, commit your changes before merging.

fatal: Exiting because of unfinished merge.

可能是之前pull下来的代码没有进行自动合并。

解决办法:

  1. 保留本地的修改(后补)

  2. 放弃本地(从线上最新版本覆盖,本地文件将被丢失)

  git fetch --all

  git reset --hard origin/master

git使用过程中问题的更多相关文章

  1. git rebase 过程中遇到冲突该怎么解决?

    在执行git rebase 过程中经常遇到问题,此时有点慌,一般如何解决呢? 1.先将本地的冲突手动解决 2.执行下面命令 git add . git rebase --contine  //继续re ...

  2. Git使用过程中出现项目文件无法签入Source Control的情况

    在VS中使用Git进行项目source control的过程中,有些文件不在source control之下,右键点击时,也找不到Undo, Commit命令 无法把他们签入进Source Contr ...

  3. git提交过程中遇到的 index.lock 问题导致无法提交的解决方法

    在提交代码的过程中,可能会遇到下面的问题: fatal: Unable to create 'C:/programLists/zzw-q1/.git/index.lock': File exists. ...

  4. Git使用过程中的问题

    Q-1:怎么切换到远程的分支 本地已经有一个代码库了(是从github上clone的),但是现在远程库中一个新的branch,怎么拉取远程分支,并在本地创建该分支(内容一样).how to do? # ...

  5. 关于GIT使用过程中遇到的问题

    npm构建,将所需要安装的依赖添加至package.json文件中,使用cnpm i进行安装 #拉去指定项目的默认分支: git pull http://username:password@gitla ...

  6. git使用过程中遇到的问题及处理方法

    1. Your local changes to the following files would be overwritten by checkout:......Please commit yo ...

  7. git 使用过程中遇到的问题does not appear to be a git repository Could not read from remote respository

    想把本地的git库上传到github上.github已经新建了一个public仓库,利用网站的命令 git Bash报错:does not appear to be a git repository  ...

  8. 如何解决git====push 过程中出现的。error: failed to push some refs

    当我们在利用git  push 文件到仓库时出现了一下问题: ! [rejected] master -> master (fetch first)error: failed to push s ...

  9. git使用过程中遇到的错误

    1.使用git add "login.py" 然后git commit -m "add url"的时候报错.分支newtype也是存在的 nothing to ...

  10. git使用过程中的若干问题笔记

    1.关于本地分支创建之后,如何在远程创建同名分支并完成本地分支到远程分支的push 首先创建本地库分支以dev为例 然后输入命令git push --set-upstream origin dev / ...

随机推荐

  1. 随笔-ansible-5

    1.Includes的使用场景 A项目要用重启PHP B项目要用重启PHP C项目要用重启PHP 可以将重启PHP这个task独立成一个playbook文件,供他人引用即可. 首先编写重启PHP的文件 ...

  2. 新建一个servlet类,继承HttpServlet,但是无法导入HttpServlet包

    描述: 原因:缺少tomcat的libraries(HttpServlet对应位置在tomcat的lib中====) 解决: 1. 2. 3. 4.

  3. linux安装lolcat实现彩色文字输出信息

    [root@localhost ~]# mount /dev/sr0 /media/[root@localhost ~]# rpm -ivh epel-release-latest-7.noarch. ...

  4. 笔记57 Mybatis和Hibernate的比较

    一.Hibernate和MyBatis简介 1.Hibernate简介 Hibernate对数据库结构提供了较为完整的封装,Hibernate的O/R Mapping实现了POJO 和数据库表之间的映 ...

  5. Linux系统的buff/cache缓存清理脚本

    cacheClean.sh #!/bin/bash # 日期: # 作者: 黄慧丰/何鹏举 # 说明: fastdfs所在的linux系统的buffer cache过大, 且并没有有效的自动回收, 因 ...

  6. ubuntu 16.04 pecl 不能安裝 mcrypt

    vagrant@ubuntu-xenial:/etc/apt$ sudo pecl install mcrypt-1.0.1 downloading mcrypt-1.0.1.tgz ... Star ...

  7. Apache 环境变量配置

    在path 中加入  C:\__S_D_K__\AndroidApache\apache-ant-1.9.14\bin 我的路径在C盘

  8. CSS案例1(导航栏)

    文本的装饰 text-decoration 通常我们用于给链接修改装饰效果 使用技巧:在一行内的盒子内,我们设定行高等于盒子的高度,就可以使文字垂直居中. <head> <meta ...

  9. bzoj1011题解

    [解题思路] 这题解法很多,我也不知道标算是什么..这简直就是大放水啊.. 网上流传的乱搞法,对于小范围内(假设为[1,l]∩N)暴力,大范围内估算. 我写这题时还是写P的?!..但是我看不懂我当时写 ...

  10. 牛客多校第三次B——线段树维护线性基交

    写线性基交函数时调试了半天.. #include<bits/stdc++.h> using namespace std; #define ll long long #define maxn ...