A pure JavaScript implementation of git for node and browsers!
src: isomorphic-git official
在当前项目安装isomorphic-git
npm install isomorphic-git --save
nodejs环境使用isomorphic-git创建裸仓库
const git = require('isomorphic-git');
const fs = require('fs');
async function createBareRepository(dir) {
await git.init({
fs,
dir,
bare: true
});
console.log('裸仓库创建成功');
}
// 使用示例
createBareRepository('./my-bare-repo.git');