Clone private Mercurial repository on bitbucket.org into InetlliJ IDEA with hg4idea plugin? - intellij-idea

I created private repository on bitbucket.org. I want to use it from IntelliJ IDEA.
I choose "Check out from Version Control" and there is message box with field Mercurial Repository URL and Test Repository button.
What should I enter into Mercurial Repository URL?
I tried
http://bitbucket.org/my_user_name/my_repo_name,
https://, and https://my_user_name#bitbucket.org/my_user_name/my_repo_name.
Nothing works.
When I click Test Repository I always get the message "Repository test has failed.".
I assume it is because there is no field for username and password, but can't I enter this data somehow?

Since only the latest hg4idea version supports authentication, you could try, for accessing and cloning your Bitbucket repo:
hg clone http://myuser:mypassword#bitbucket.org/MY_USER/MY_REPO
(that is, if your Bitbucket repo is a private one, which you did mention in your question:
'myuser' and 'mypassword' would then be the login and password for your Bitbucket account, using basic access authentication for the http url)

I was able to get this working by cloning the repository via a command-line prompt using the command that BitBucket gives me on my overview page. After doing that and activating version control on the project in IDEA, IDEA allowed me to push and pull from the repository successfully.

Related

How to push Fossil local repository to remote hosting

It would be great if you could help me with one thing.
I'm using Fossil as my version manager. Using this on my PC is not a problem but when I try to push it to remote repository I can't.
Here's the thing:
When inside folder with my repository I type
fossil push https://chiselapp.com/user/sebatbg/repository/nres
I get info that:
Error: Wrong project
When I type
fossil push https://sebatbg#chiselapp.com/user/sebatbg/repository/nres
It asks for my password but when I enter it fossil says that Login failed
I tried both my pass to chisel app and for specific repository but result is the same.
Could anyone tell me step by step how to do the push?
Thank you
Fossil assigns a unique ID, called the "project ID", to each new repository. The error message "Wrong project" means that you've got different repositories locally and remotely, that their project-IDs don't match.
The only way I know to publish an existing local repository on Chisel is to upload said repository, and then set the remote-url of your local repository to the Chisel URL, either explicitly or by pulling from the URL.
I had a similar problem. I had cloned a remote repository, but could not push to it.
I could solve it by adding the username to the remote url
remote-url https://{username}#chiselapp.com/user/{chiselab-user}/repository/{repository-name}
you are then prompted for the password of the remote repository.
If you have an existing local repository that you would like to upload to the chiselapp hosting service, the process can be a bit awkward. If your repository is smaller than 8M, chiselapp provides a command Upload repository that may suit your purposes. Otherwise, this is what you need to do:
Navigate to a source tree for the local repository.
Issue the fossil info command and copy the project-code of the local
repository. This is a SHA1 hash.
Log in to chiselapp.com website and click on the Create Repository
link in the header of the home page.
Paste the previously copied project-code into the Override Project Code
field of the resulting form.
Fill the remaining fields as appropriate and click the Create Repository
button at the bottom of the page.
Record the password that is then assigned to you.
Navigate to the chiselapp dashboard and click on the name of the newly
created repository. This should bring you to the fossil web interface of this repository.
Login to the new repository using your local username and the recorded
password. This should be the only user so far and should have setup user permissions.
Navigate to the Admin/Stats page and check that the Project ID of the new
remote repository matches the project-code of the local repository.
Back in the local repository's source tree issue the command
fossil push https://<username>:<recorded-password>#chiselapp.com/user/<username>/repository/<repository-name> -R <local-repository-file>

How to switch Intellij Idea project vcs between Gitlab and Amazon CodeCommit?

I am new with Amazon codecommit.
Following their instruction, I did some works like below
make a new IAM user with AdministratorAccess
make a new codecommit repository
install awscli and did aws configure
When I right finished those things, I could pull/push from codecommit.
However it became disabled with intellij Idea.
I did something like...
I pull a project from gitlab
git remote rm origin
git remote add origin [code commit url]
git branch --set-upstream-to origin/master
Now I type git [pull / push] origin master, I got this error message.
unable to access 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/test17/': The requested URL returned error: 403
When I access this url via browser, it requires id/pw. But my IAM user account information is not working.
What should I do? Is there any way to switch gitlab and codecommit in intellij?
Thanks.
IntelliJ does not use awscli. It uses the default system shell.
From the description, it looks like push/pull does not work for the command-line git in the native shell, so the issue is not IntelliJ-related.
Probably git tries to use wrong credentials save in its credential.helper, that is why it fails.
Check git config credential.helper to see if any is configured. If there is one, try disabling it or clear the saved credentials.
From the description it looks like you are trying to connect to a CodeCommit repository in Intellij using https. To do this you need to generate GitCredentials(username/password) for your iam user in the IAM console.
Detailed steps are documented in the aws documentation: http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html
Once you have the username/password you can use those credentials to connect to your CodeCommit repository in Intellij.
Tested on a Mac. Your milage may vary!
I just ran into the same issue. MacOS stores the GIT UID and PW in the Keychain (in your Applications > Utilities Folder). I deleted all references to AWS Code Commit from the keychain, which forced me to reenter the UID & PW. This seems to have solve the problem.
As a side note: I think this happened because I revoked a prior GIT credential on AWS and created a new one. I think that the keychain was entering the old UID/PW which then failed during authentication.
First, you are going to want to create an IAM user with appropriate permissions and then create Git credentials. Then go to IntelliJ IDEA and say you are opening project from VCS with Git credentials, use the AWS git credentials you created and log in. Once you have logged in, you should be able to pull/push to the repo. If you are still having issues and have checked the credentials you are using are active, along with the IAM user those credentials are attached to have the right permissions, I would recommend creating a ticket on AWS support as there may be something wrong with your account that AWS staff will need to fix.

Generate key files to connect to Bitbucket in Vagrant boxes

We use Vagrant boxes for development. For every project or small snippet we simply start a new box and provision it with Ansible. This is working fantastic; however, we do get into trouble when connecting to a private Bitbucket repository within a bower install run.
The solution we have now is to generate a new key (ssh-keygen), accept all defaults (pressing <return>, <return>, <return>) and then grab the public key (cat ~/.ssh/id_rsa.pub). Copy it, go to Bitbucket, view your account and add this new ssh key. And repeat for every new box you instantiate.
We have to do this because of some closed source packages (hosted on Bitbucket) we install via Bower. We do have another experience, which is much better: composer (php's package manager) and private Github repositories. With that setup, you have to enter your username/password/2fa token via the command line and an OAuth token is generated for you. This works great.
So, is there a way we can mitigate this bower/bitbucket/ssh issue? For obvious reasons I don't want to provision the boxes with a standard private key, but there has to be another solution?
While I'm not sure that my situation is as complex as yours (I'm not using Ansible or Bower), I solved this problem by using the Vagrant ssh forward agent. This blog post gives you the details on how to get it working:
Cloning from GitHub in Vagrant using SSH agent forwarding
So as long as each of the developers has access on their local machines to the bitbucket repos, it should work.

Authentication failed publishing a repository from Github for Windows

I am trying out Github for Windows and I am getting the following error when I try to publish a newly created repository.
Authentication failed
Your credentials may be out of date. Please log out of the application and then log back in before retrying the operation.
Needless to say I've logged out and back in multiple times without success. I've also uninstalled and installed the latest version to no avail.
The repository is a new one I created within the application and contains only the .gitattributes, .git and README files.
I am a complete newbie to Github so it's quite possible I've messed something up during the setup process.
I was able to solve this by:
Press Settings - Open in GitShell.
git status
git push (or pull)
introduce credentials (here is the most important step, somehow git client messed up or forgot your credentials).
After giving correct credentials you can exit from git shell and use git client again.
It turns out that the problem was Github for Windows was having a problem with the password it had stored. Github support's instructions were as follows:
Log out of Github for Windows.
Change my password on github.com
Log back into Github for Windows.
I was then able to publish my changes.
Did you setup your ssh keys?
https://help.github.com/articles/generating-ssh-keys#platform-windows

How do I use Git Extensions with a Bitbucket repository?

I have repository on both github.com and bitbucket.org, and I am very familiar using Git Extensions for all repository functions... But when I started using bitbucket.org repositories I have to use TortoiseHg SVN for it ... so I want to ask that is there a way I can use Git Extensions for Bitbucket repositories?
I haven't fully tested it, but these steps allowed me to clone a Bitbucket repository in Git Extensions.
You can use PuTTY to generate a public/private SSH key, then add that key to Bitbucket.
Run GitExtensions\PuTTY\puttygen.exe
Click Generate
Click Save public key (as a text file)
Click Save private key (as a ppk file)
Run GitExtensions\PuTTY\pageant.exe C:\path\to\ppk-file.ppk
Log into Bitbucket
Go into Account settings (Settings → Security → SSH keys*)
Paste your public key into the SSH keys text input as (spaces are important, do not include square brackets around the public key):
ssh-rsa [AA-YOUR-PUBLIC-KEY-ALL-ONE-LINE-SPACES-REMOVED-==] youremail#domain.example
Click Add key
In Git Extensions, click Clone repository
Use the SSH repository link on Bitbucket as the repository to clone
Click Load SSH key
Browse to and load the ppk file
Click Clone
I found that most of this worked for me with just a few small changes.
Run GitExtensions\PuTTY\puttygen.exe
Click Generate
Click Save public key (as a text file)
Click Save private key (as a ppk file)
Didn't have to run this step --Run GitExtensions\PuTTY\pageant.exe C:\path\to\ppk-file.ppk--
Log into bitbucket
Go into Account settings
Paste your public key into the SSH keys text input as (spaces are important but with no email address on the end): ssh-rsa [AA-YOUR-PUBLIC-KEY-ALL-ONE-LINE-SPACES-REMOVED-==]
Click Add key
In Git Extensions, click Clone repository
Use the SSH repository link on bitbucket as the Repository to clone ( i.e. git#bitbucket.org:yourname/repo.git)
Click Load SSH key
Browse to and load the ppk file
Click Clone
Also I found that I was having a problem saying that the machine I was looking for might not be the correct one. I found this very helpful and if you are having problems might be useful Using the SSH protocol with Bitbucket and very quickly helped me through that.
It's been 10 years since the original answer was posted, and I can now get this working without using SSH:
Log into Bitbucket, click on your avatar, and go to "Personal settings".
Go to "App passwords", and click the "Create app password" button.
Create a password for Git Extensions. When selecting permissions, choose "Read" and "Write" under "Repositories". You will be shown the password only once - make a note of it.
Clone the repo in Git Extensions, using the HTTPS link from Bitbucket.
When prompted to log in, keep the default user name (don't change it to your email address), and enter the app password.
A web page will open for you to authorize Git Credential Manager to access your Bitbucket account.
Once authorized, Git Extensions should start downloading the repo.