Reputation: 16959
I have a forked Azure git web project which I am developing in Visual Code. I want this project to reflect the latest code from the master it is forking from. The forked project should never be merged with the master since it is an independent version of the product.
What is the recommended way to fetch the latest code from the master?
Can I do this directly in VS Code or do I need to handle this within Visual Studio?
Azure explanation of handling forks:
Upvotes: 6
Views: 5954
Reputation: 19036
Can I do this directly in VS Code or do I need to handle this within Visual Studio?
You can do the same sync fork to latest
feature directly in Visual studio code. Just, seems no obvious button can for you do. So, here what I provide is another steps.
1) Open View -> Terminal, run below commands in it:
git remote add upstream https://{org}@dev.azure.com/{org}/{project}/_git/{repos}
git fetch upstream
Note, here the upstream
repos link is the original repos that you forked from.
2) Change the panel to Source control, then click on three dots:
3) Select Pull from, and then pick the corresponding Upstream
link you set above.
Now, you would see that all of remote changes are fetched successfully.
In fact, these are all map with the operation in VS. Just in VScode, these need to achieve via commands.
Upvotes: 8