How to push the file to TFS using azure-devops-node-api library in NodeJS?

若如初见. 提交于 2019-12-11 16:23:49

问题


I'm trying to push the files to repository in Azure Repos. I'm using azure-devops-node-api library to connect and push the file to the repository. I'm beginner in NodeJS. Please find the below code. I'm not sure how to proceed further.

Please help!

const orgUrl = "https://dev.azure.com/orgname";
const azure = require('azure-devops-node-api');
var accessToken = "ACCESS_TOKEN";
var authHandler = azure.getPersonalAccessTokenHandler(accessToken);
var connection = new azure.WebApi(orgUrl, authHandler);
connection.getGitApi().then( gitapi1 => {
    // I don't know how to use gitapi1 to commit and push the file
});

来源:https://stackoverflow.com/questions/59171555/how-to-push-the-file-to-tfs-using-azure-devops-node-api-library-in-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!