I have a project in Visual Studio 2019 that I cloned from an empty DevOps project. It is using git. I have created a local branch in Visual Studio from master and added a new solution. I have then committed the changes, synced with the server and pushed the commit. On DevOps I created a new pull request to merge my branch into master, then approved and completed the pull request.
When I checkout master in Visual Studio and pull, it updates to the latest commit. However, I do not see the Solution in the Solution Explorer (it is empty). I pull again and it says I'm up to date.
I have tried merging from remotes/origin/master also to no success. I have tried fetching remotes/origin/master no dice. I have tried deleting master and recreating it using so that it tracks remotes/origin/master with: $ git branch -d master and $ git checkout -t remotes/origin/master and still no joy.
Thank you for reading my query. What am I missing?
Closing and re-opening Visual Studio fixed this issue for me.
I have subsequently created a new local branch from master, made some changes, pushed them, submitted and completed the pull request, and now checking out master and pulling DOES show my changes.
Not sure why it wasn't working before but my problem has been solved.
I faced the same when the Azure/Git credentials are expired or the domain password is expired.
In fact, there is a bug in VS 2019 (16.11.2 my version): no error displayed if VS failed to obtain auth. token during the pull operation.
Related
If I create pull request from a remote branch and that branch get deleted when the PR is merged, occasionally I'd like to create another pull request from that branch - which I still have locally. When I click sync in Visual Studio, it's smart enough to just recreate the branch if it was deleted, but VS Code throws the error
Git: fatal: couldn't find remote ref feature/somebranch
Is there a way to get VS Code to recreate the missing branch like Visual Studio does?
I've been trying to setup a GitHub repository for a xaramin iOS project that I'm doing on my mac.
When creating the project, this is the settings I chose
Setup Image
However on I haven't been able to push to the GitHub repo I want to, I've tried to follow Microsofts guide https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository but it hasn't worked due to Publish in version control being greyed out
Or, if your project is already bound to a git repository, simply add the GitHub remote and push it there.
git remote add github URL_TO_GITHUB_REPO
git push github master
Afterwards, Visual Studio should allow you to push to Github as well as any older remotes that were added locally.
You can always remove the existing remote if you want to:
git remote remove origin
git remote rename github origin
See also: https://stackoverflow.com/a/52052063/736079
Before publishing your project to GitHub from Visual Studio, you must remove any source control :
If you have an existing project that is
not already in version control, use the following steps to set it up
in Git
Removing the .git folder and .gitgnore file should be enough. Then the "Publish in version control..." menu will be available (you might need to restart Visual Studio).
Source : https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository?view=vsmac-2019#publishing-an-existing-project
So we're using TFS2013 and I created a test folder, then added a test file to it, then converted the folder to a branch and then deleted the branch. (I did this to see what would happen if you try to delete a branch that has files checked out). But when I open TFS on another machine I still see that branch. Locally it's disappeared from view, but on the remote server (our build server) it still shows up as being there. I checked out the test file on the remote machine and then deleted the branch on my local machine, so I thought it was still appearing because I had pending changes, but I undid them, refreshed source control explorer and even closed and reopened VS and it still appears there. I checked with another developer and he doesn't see it, but I still don't understand why it's appearing on the build server.
Anyone have any ideas?
You need to check in the Pending Changes after deleting the branch, otherwise the branch will not be deleted from remote server.
For other client machines which ever connected to the project, you need to Get Latest Version from the remote server to delete the existing local branch. (Sync with remote server to delete the branch)
Right-click on the branch in Visua Studio then select "View History".
On the top of the list you should see the changeset related to the deletion, Right-click on it then select "Get This Version".
I know several people has already asked this question but I tried almost every approach and did not help me. I am trying to delete a branch in TFS 2010 and I am unable to do this operation. When I try to checkin my delete operation I get following message
TF14098: Access Denied: User xyz needs Checkin permission(s) for $/Path to branch/*.
I remember until few months back, I was able to delete the branch but not it is not working.
I modify the files inside the branch but when I try to rename the branch or try to delete it then I get above error message.
I have tried method proposed in this answer: Removing branch mapping in Team Foundation Server 2010
I would like to add one more thing. If I create branch using visual studio 2010 then I can delete that branch later however if I create branch using visual studio 2013 then I can not delete that branch.
I would like some advice on how to use Git locally on my computer along with Visual Studio and a TFS server. Unfortunately the technical leader of my company has set TFS with the exclusive check-out policy and so every time someone checks out a file, it can't be edited by someone else.
What is the right way to make the two systems live together? I would try to use Git-TF but I'm not convinced with the checkin phase. The workflow should be as the following:
clone the project
switch to offline mode for Visual Studio
work offline with Git
fetch from the TFS server and rebase
check-in?
The problem is: how do I check-in my files if someone else has already checked out the files I need to change? How does Git-TF really work when checking-in files?
Another workflow that came to my mind, without Git-TF, could be the following:
open the TFS project
switch to offline mode
create a new branch with Git
work on the branch
return to the master branch, update it
exclusively checkout the files which have been changed on my Git branch
merge the branch on master
check in with TFS (after switch to online mode?)
What do you recommend?