You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.
This should be an easy fix and I think it could be helpful for user looking to create a new branch.
createReference is passed three arguments:
ghrepo.createReference('master', '18293abcd72', callback);
The first argument should be the new branch name.
The second argument should be the SHA-1 hash value of the commit to branch off.
A better example would be as follows:
// get the latest commit
ghrepo.commits((err, status, body, headers) => {
if (err) { console.log('err', err) }
if (status) {
// for some reason status is an array of object that contains our commits.
// status[0] is the latest commit and we pass it to createReference
ghrepo.createReference('newBranchName', status[0].sha, (err, status, body, headers) => {
// do your stuff here
});
}
});
I was also inspecting the definition of createReference on line 340 for repo.js and it looks correct! In my personal opinion, the example within the documentation is slightly misleading. I had to dive into the definition and source other examples to get a better understanding.
If you approve, I could create a PR for this.
The text was updated successfully, but these errors were encountered:
This should be an easy fix and I think it could be helpful for user looking to create a new branch.
createReference is passed three arguments:
ghrepo.createReference('master', '18293abcd72', callback);
The first argument should be the new branch name.
The second argument should be the SHA-1 hash value of the commit to branch off.
A better example would be as follows:
I was also inspecting the definition of createReference on line 340 for
repo.js
and it looks correct! In my personal opinion, the example within the documentation is slightly misleading. I had to dive into the definition and source other examples to get a better understanding.If you approve, I could create a PR for this.
The text was updated successfully, but these errors were encountered: