VSTS使用git push部署到远程存储库

时间:2018-03-05 22:30:08

标签: git deployment azure-devops release

我目前正在使用VSTS来托管包含WordPress网站的git存储库。我想使用SSH将此存储库推送到远程(wpengine)。我目前没有看到如何做到这一点并且在构建可以执行此操作的版本方面收效甚微 - 没有任何指南和插件的文档在这里看起来有用并不是很完整。 VSTS版本中是否有内置功能允许这样做?

1 个答案:

答案 0 :(得分:1)

My work flow is to push up into a remote repository and pull down, ssh'd into your site. This always for you to commit back to a working version of your staging/production site if a bug is caught, it allows for a workflow where a pull request can be issued and reviewed if necessary and of course, a single point, where code can be reverted if necessary.

Here is my paraphrased workflow:

Create your own personal token on vsts.

These are the instructions: https://www.visualstudio.com/en-us/docs/setup-admin/team-services/use-personal-access-tokens-to-authenticate

  1. Click on your personnel icon(top right corner) on vsts.
  2. Click on Security
  3. Click on Personnel Access tokens
  4. Click on Add new
  5. Save the generated token

Create Alternate Authentication credentials

  1. Click personnel icon(top right corner) on vsts
  2. Click on Security
  3. Click on Alternate authentication credentials
  4. Make sure you fill in the ‘User name (secondary)’, this will be part of your security code

SSH TIME

  1. Open Putty or ssh client
  2. Type ‘cd html’ (this is where go daddy is stored)
  3. Type ‘git init’
  4. Type ‘git fetch remote https://(usernamesecondary):(personalaccesstokencode)@~~~~~.visualstudio.com/GitcloneUrl . . Or 'git remote add salessite https://(usernamesecondary):(personalaccesstokencode)@~~~~~.visualstudio.com/GitcloneUrl .'

**salessite is the name of the repo

  1. 'git pull salessite'
  2. 'git checkout –f branchname'

Be sure to have the ending period(.) as this will fill in the contents of the directory without the directory name.

Hope this is helpful. I working on a tutorial for using Visual Studio git setup coming up.