我正在尝试使用git分支
将我的所有分支放入一个列表中。我当时想的是
const branches = executecommand('git branch -l')
但我不知道正确的方法。
最佳答案
我认为 Node 核心中的 child_process
模块就是您想要的:
const cp = require('child_process')
const branches = cp.execSync('git branch -l')
关于javascript - 将 git 分支列表存储在变量中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56877324/