coolair
V2EX  ›  问与答

git clone 下来的项目为什么经常不能 git pull?

  •  
  •   coolair · Apr 24, 2019 · 4637 views
    This topic created in 2752 days ago, the information mentioned may be changed or developed.
    提示如下:


    删除项目重新 clone 后再 pull 又没有问题,这是为什么,不是所有项目都会这样,偶尔会有几个项目会这样。
    19 replies  •  2019-04-24 17:19:19 +08:00
    luckyx
    luckyx
    Apr 24, 2019 via iPhone
    1
    插个眼…
    虽然感觉是在 master 新建文件的锅但是不能确定 看楼下大佬表演
    gaius
    gaius
    Apr 24, 2019
    2
    不是让你设置用户名和邮箱吗
    crazybug
    crazybug
    Apr 24, 2019
    3
    git remote -v
    leafre
    leafre
    Apr 24, 2019
    4
    tell me who you are
    coolair
    coolair
    OP
    Apr 24, 2019
    5
    @gaius 不是设置用户名和邮箱的问题,我又不 push,即便是设置了用户名和邮箱还是一样没有用,只能删了重新 clone。
    GM
    GM
    Apr 24, 2019
    6
    看提示。
    看不懂就谷歌翻译。

    我真的很不明白为什么那么多人不看错误信息就发问。
    hash
    hash
    Apr 24, 2019
    7
    看提示解决问题就好.
    没遇见过 pull 也要配置用户名和邮箱,或许是因为 Windows 下取到的不合法.
    GM
    GM
    Apr 24, 2019
    8
    @coolair pull 下来后会做合并,合并成功后 git 会自动 commit,然后 commit 会用到你的用户名和邮箱,了解一下。
    hash
    hash
    Apr 24, 2019
    9
    @coolair 将用户信息配置到项目,而不是全局试试
    ysc3839
    ysc3839
    Apr 24, 2019 via Android
    10
    @GM 但如果本地没有 commit 的话会 fast-forward,不会 merge commit 的。
    coolair
    coolair
    OP
    Apr 24, 2019
    11
    @GM 我在本地又没有修改为什么会 commit ?
    GM
    GM
    Apr 24, 2019
    12
    @ysc3839
    @coolair
    那就不知道了,也许新版的 git 要求必须要有 username 和 email 也说不准。
    gotounix
    gotounix
    Apr 24, 2019
    13
    我也碰到过这样的问题,实项目没有修改过,但是 git status 会提示 branch diverged。
    gotounix
    gotounix
    Apr 24, 2019❤️2
    14
    最粗暴的解决方法:
    git fetch --all
    git reset --hard origin/master
    Vegetable
    Vegetable
    Apr 24, 2019
    15
    是 merge 需要用户名和邮箱?感觉也不对,没邮箱的的话你本地应该也不会有 commit
    gotounix
    gotounix
    Apr 24, 2019❤️1
    16
    而且,你在 Windows 下还的注意一些 Windows 的局限性,比如:目录名称问题。
    看这个项目:
    https://github.com/huangyz0918/Hackintosh-Installer-University/tree/master/Clover-Configs/Lenovo/Yoga3 -14 /CLOVER
    https://github.com/huangyz0918/Hackintosh-Installer-University/tree/master/Clover-Configs/Lenovo/ThinkPad L460 /CLOVER
    他的目录 Yoga3 -14 和 ThinkPad L460 后面有一个空格,clone 到 windows 下后,windows 会把后面的空格删了,造成了目录不一致,就会导致本地修改。
    SoloCompany
    SoloCompany
    Apr 24, 2019 via iPhone
    17
    git pull — rebase
    iasuna
    iasuna
    Apr 24, 2019
    18
    @coolair 这个报错显示的就是没设置用户名邮件啊 你要是设置完了还不行 把设置完的报错截图发上来啊 不知道报错是什么我们怎么提供建议。。。
    DANG
    DANG
    Apr 24, 2019
    19
    百度一下 ×
    V2ex 发帖 √
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4533 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 100ms · UTC 05:43 · PVG 13:43 · LAX 21:43 · JFK 00:43
    ♥ Do have faith in what you're doing.