git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
twofox
V2EX  ›  git

VSCode 签出分支总是自动签出到旧版本,可能是什么原因造成的?

  •  
  •   twofox · Jan 24, 2022 · 2049 views
    This topic created in 1568 days ago, the information mentioned may be changed or developed.

    使用 VSCode 连接公司 gitlab ,工作过程中经常会切换不同客户的分支。 然后使用 VSCode 签出功能,总是发现签出的版本不是最新的(本地没有这个分支) 然后我都得使用 Git Graph 这个插件,选择 Fetch From Remote 这样才会显示远程仓库有新版本,然后再更新一次项目

    3 replies    2022-01-24 17:14:30 +08:00
    4771314
        1
    4771314  
       Jan 24, 2022   ❤️ 1
    git pull && git checkout -b new-branch
    rbe
        2
    rbe  
       Jan 24, 2022   ❤️ 1
    fetch 的时间间隔太长了。要么手动 git fetch --all, 要么设置 git.autofetchPeriod 设得短一点。
    Vegetable
        3
    Vegetable  
       Jan 24, 2022   ❤️ 1
    签出远程仓库实际上是在签出本地已经 fetch 过的代码,而不是实时拉取。如果你没有 fetch 直接签出,就有可能得到旧的代码。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4842 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 00:15 · PVG 08:15 · LAX 17:15 · JFK 20:15
    ♥ Do have faith in what you're doing.