FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/examples/create-branch.js at fix-commit-doc · KeysEthos/nodegit · GitHub
KeysEthos
nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
examples
/
create-branch.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (17 loc) · 460 Bytes
Breadcrumbs
nodegit
/
examples
/
create-branch.js
Copy path
File metadata and controls
18 lines (17 loc) · 460 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var
nodegit
=
require
(
"../"
)
;
var
path
=
require
(
"path"
)
;
nodegit
.
Repository
.
open
(
path
.
resolve
(
__dirname
,
"../.git"
)
)
.
then
(
function
(
repo
)
{
// Create a new branch on head
return
repo
.
getHeadCommit
(
)
.
then
(
function
(
commit
)
{
return
repo
.
createBranch
(
"new-branch"
,
commit
,
0
,
repo
.
defaultSignature
(
)
,
"Created new-branch on HEAD"
)
;
}
)
;
}
)
.
done
(
function
(
)
{
console
.
log
(
"All done!"
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL