- Install Git on your PC first.
- Create a project with Git as version control on your Visual Studio Team Services website.
- Get the URL of the new project after it is created,
i.e., https://developer2201.visualstudio.com/WebApp1/_git/WebApp1 - Assuming your Visual Studio solution folder is C:\Dev\VS2017_Eval\WebApp1...
- Open command line console. Go to "C:\Dev\VS2017_Eval\WebApp1".
- Run command: git init
- Run command:
git remote add origin https://developer2201.visualstudio.com/WebApp1/_git/WebApp1 - add ".gitignore" file to the folder. You can download it from github at
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore. - Run command: git add .gitignore
- Run command: git commit -m ".gitignore file added"
- Run command: git add *
- Run command: git commit -m "Initial source codes"
- Run command: git push -u origin --all
Step 13 can be done in Visual Studio by using Sync and Push in outgoing commit in Visual Studio, too.
No comments:
Post a Comment