我尝试使用nodejs进行多文件提交。就像你提交并通过命令行使用git一样。
为了实现这一点,我已经研究了几个节点模块,遗憾的是它们都没有提供多文件提交。这不可能吗?如何通过命令行工作?
这些是我尝试过的几个API:
答案 0 :(得分:0)
我使用节点github api编写了一个小模块,允许在github上提交repos,而不必使用Git
https://github.com/Ramshackle-Jamathon/commit-to-github
var commitToGithub = require("commit-to-github");
commitToGithub({
user: "Ramshackle-Jamathon",
repo: "commit-to-github",
token: "<a-github-oauth-token>",
files: [
{path: "foo.txt", content: "nice words!"},
{path: "sick-folder/bar.txt", content: "you're the best!"},
],
fullyQualifiedRef : "heads/master", //optional default = "heads/dev"
forceUpdate: true, //optional default = false
commitMessage: "great work!" //option default = "AutoCommit - " + new Date().getTime().toString();
}).then(function(res){
// success!
}).catch(function(err){
// oh no! something went wrong
})