I don't know what the best way is to setup Visual Studio and a remote Git repo and link them together. I've looked at some videos and read some articles but I'm still getting the "rejected updates because the remote contains work that you do not have locally". Here are the steps I took. Can someone tell me the step I'm missing or if there is a different way I should go about doing this?
- Created a remote Git repo through our TFS website. This is an on-premise server.
- Cloned the remote repo down to C:\TFS\Projects\RepoName.
- Opened Visual Studio 2017 and created an new console app. I pointed the folder to the C:\TFS\Projects and name the project the same as the RepoName I used in cloning. I unchecked the "Create Folder" and "Add to Git" boxes.
- In VS went to File | Add To Source Control.
- Added a test file and then tried to Sync to the remote repo and get the error.
git pull
to retrieve the latest changes, then. – Andygit pull --rebase origin master
– Andy