-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a button to clone branches #2895
Comments
Only way it through v3 api |
You can already clone it:
|
@fregante wow I never knew that!! |
If this “Duplicate” button is added to the Branches page, it can replace this feature request: #2500, also because renaming isn’t a safe operation |
@fregante curious why is renaming not a safe option? |
Explained in #2500: it doesn’t move PRs |
query GetBranchInfo {
repository(owner: "yakov116", name: "TestR") {
id
ref(qualifiedName: "Test") {
target {
oid
}
}
}
}
mutation CreateBrach {
createRef(input: {repositoryId: "MDEwOlJlcG9zaXRvcnkyNDQyMTU0NzY=", oid: "a1a98b7b5460f87a31cc6e12699a6e71e2390988", name: "refs/head/yes"}) {
clientMutationId
ref {
id
}
}
} @fregante like this? Or do you want to hack the drop down menu? |
If v3 only requires a |
On https://github.com/sindresorhus/refined-github/branches
|
They both require 2 calls. One to get the commit the brach is up to. And one to create the branch. Creating the branch via V3 is simple. |
Ugh. The GraphQL schema for this is awful. Private IDs should not be exposed at all. Two v3 calls are fine since it's a specific user action. This is not exactly a high-priority feature though. |
await api.v3( |
The last OR sounds good. V4 GET, V3 POST |
V3 I can get the direct info |
What’s direct info? V4 also has the commit info, it’s just what we need. V4 requests are light, v3 GET requests aren’t |
await api.v3( |
I have every thing done I am having a hard time making a post |
Why do you keep asking this? I said it before. Is this going to be like your last PR of me saying the same thing 4 different ways before the code was updated? |
No no. I know I know. Your right. It was a mistake that line got in there |
@szmarczak why do you need to clone a branch? |
Sometimes I need to rebase a PR I'm working on (e.g. start from scratch with a different implementation) and I don't want to lose the current progress. |
Commits aren't lost, you just need to save the commit hash |
IKR, but I'm lazy to do so :( |
I think that the |
To clone a branch manually:
Edit
on any file. Do not make any changes.Propose file change
button.disabled
attribute.Propose file change
.🎉 In other words, it makes a spin off from your branch and makes an empty commit (I don't know of any solution that wouldn't create an empty commit).
The text was updated successfully, but these errors were encountered: