| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 417cb4f commit 2627e28
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + var nodegit = require("../"); | ||
| 2 | + var path = require("path"); | ||
| 3 | + var Promise = require("nodegit-promise"); | ||
| 4 | + var promisify = require("promisify-node"); | ||
| 5 | + var fse = promisify(require("fs-extra")); | ||
| 6 | + | ||
| 7 | + nodegit.Repository.open(path.resolve(__dirname, "../.git")) | ||
| 8 | + .then(function(repo) { | ||
| 9 | + // Create a new branch on head | ||
| 10 | + return repo.getHeadCommit() | ||
| 11 | + .then(function(commit) { | ||
| 12 | + return repo.createBranch( | ||
| 13 | + "new-branch", | ||
| 14 | + commit, | ||
| 15 | + 0, | ||
| 16 | + repo.defaultSignature(), | ||
| 17 | + "Created new-branch on HEAD"); | ||
| 18 | + }) | ||
| 19 | + }).done(function() { | ||
| 20 | + console.log("All done!"); | ||
| 21 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments