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
Prompt user for remote location #545
Comments
I'm going to prompt when pushing so an existing repo can be converted into an online repo. |
That's a very good idea. We may need to check for existing remotes to help decide whether or not to prompt. |
You should probably be asking the user for a remote when they create the repo. If you have an existing repository without remote you're better off asking when opening that repo and disabling push functionality until a remote is added to the repository. It may lead to interesting conflicts if you add a remote location to a repo with existing history. Consider that github for example usually initializes your repo with an "initial commit". This can already lead to conflicts and push rejections. Maybe it's better to avoid that problem by asking for the remote as soon as possible. |
That's a good point, and possibly what I was thinking when I creating this issue. I wish I had flushed out the feature better at the time... |
Okay. I've done some research and here's the work flow to get a local repository up to GitHub.
GitHub: Adding an existing project to GitHub via the command line. Step 3 is where we're going to run into trouble. Thankfully, GitHub has a public API. We can leverage it to create the repository via a HttpClient. The only thing I'm unsure of at the moment, is if username/password auth works with GitHub's WebApi. (Part of me hopes it doesn't. I hate to think of sending passwords over a http request). Given all of that, I think that we should perhaps take after Visual Studio, and change the "Push" button to "Publish" if there is no remote repository. Or perhaps provide it as a separate control/menu option. |
If you start using an https API, you might need to accommodate users with proxy settings? |
Maybe. I need to prove to myself that I can actually create a repository first. I tried for a long while this morning & couldn't manage it. Sending GET requests with both basic auth & personal access token returned a 200, but every time I tried to POST, I got a 404. |
@ckuhn203 This is the issue: In order to set it as the remote repo, LibGit2 says I need to set the remote name for the branch to "origin" and the Tracking to "refs/heads/master". With a perfectly empty repo, this does not work, because the branch "master" does not yet exist. How do I handle that? |
I honestly don't know. Personally, I'm happy to tell people that they should create the GitHub repo first, clone it, then add the project to it for now. |
Umm, I had written this, but never merged it. Now that the UI is being worked on, I guess it is kind of late. |
Possibly related to #544. Currently, there's no way for the user to specify a remote location. Either upon creation of a repository (or upon pushing?) prompt the user for a remote.
The text was updated successfully, but these errors were encountered: