Skip to content
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

Closed
rubberduck203 opened this issue May 22, 2015 · 10 comments
Closed

Prompt user for remote location #545

rubberduck203 opened this issue May 22, 2015 · 10 comments

Comments

@rubberduck203
Copy link
Member

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.

@rubberduck203 rubberduck203 added this to the Version 2.0 milestone May 22, 2015
@rubberduck203 rubberduck203 self-assigned this Jun 27, 2015
@Hosch250 Hosch250 assigned Hosch250 and unassigned rubberduck203 Jan 24, 2016
@Hosch250
Copy link
Member

I'm going to prompt when pushing so an existing repo can be converted into an online repo.

@rubberduck203
Copy link
Member Author

That's a very good idea. We may need to check for existing remotes to help decide whether or not to prompt.

@Vogel612
Copy link
Member

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.

@rubberduck203
Copy link
Member Author

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...

@rubberduck203
Copy link
Member Author

Okay. I've done some research and here's the work flow to get a local repository up to GitHub.

  1. Init a local repository.
  2. Add some files to it & commit.
  3. Create an empty GitHub repository.
  4. Add the GitHub repository as a remote.
  5. Push

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.

@ThunderFrame
Copy link
Member

If you start using an https API, you might need to accommodate users with proxy settings?

@rubberduck203
Copy link
Member Author

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.

@Hosch250
Copy link
Member

@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?

@rubberduck203
Copy link
Member Author

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.

@Hosch250
Copy link
Member

Hosch250 commented Feb 4, 2016

Umm, I had written this, but never merged it. Now that the UI is being worked on, I guess it is kind of late.

@Hosch250 Hosch250 removed their assignment Apr 2, 2016
@Hosch250 Hosch250 self-assigned this Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants