You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将Visual Studio在研项目版本推为VSTS Git分支?

How to Push Your In-Progress Project to a VSTS Branch Without Copy-Pasting Files

Hey there! You’re totally right to avoid copy-pasting files—that’s messy and error-prone. Here’s a clean, Git-native way to get your in-progress work into a dedicated VSTS branch:

Step 1: Set up Git in your in-progress project folder

First, open a command prompt (or Git Bash) and navigate to the network drive folder where your latest work lives:

cd "Z:/Path/To/Your/In-Progress/Project"

If this folder doesn’t already have a Git repo initialized, run:

git init

Connect this local repo to your existing VSTS repo (the same one where you pushed the MAIN branch):

git remote add origin https://your-vsts-account.visualstudio.com/YourProject/_git/YourRepo

(Replace the URL with the actual clone URL of your VSTS repo—you can grab this directly from the VSTS repo page.)

Step 3: Create and switch to a new branch

Make a dedicated branch for your in-progress work (name it something descriptive, like dev/latest-in-progress or feature/new-feature-wip):

git checkout -b dev/latest-in-progress

Step 4: Stage and commit your work

First, add a .gitignore file to exclude unnecessary files (like bin/, obj/, or local config files) so they don’t bloat your VSTS repo. Once that’s set up, stage all your project files:

git add .

Commit the changes with a clear, informative message:

git commit -m "Push latest in-progress version: Added X feature, updated Y module"

Step 5: Push the branch to VSTS

Finally, send the new branch up to your VSTS repo:

git push origin dev/latest-in-progress

Bonus: Alternative workflow (if you don’t want Git in the network folder)

If you’d prefer not to keep a Git repo directly on the network drive, you can:

  1. Clone your VSTS MAIN branch to a local folder on your machine:
    git clone https://your-vsts-account.visualstudio.com/YourProject/_git/YourRepo
    
  2. Create and switch to a new branch locally:
    cd YourRepo
    git checkout -b dev/latest-in-progress
    
  3. Copy all your in-progress files from the network drive into this local repo folder (overwriting existing files as needed).
  4. Stage, commit, and push the changes just like in steps 4-5 above.

Either way, you’ll end up with a clean branch in VSTS containing your latest work—no copy-pasting chaos required!

内容的提问来源于stack exchange,提问作者CyborgHobbit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:10:31