1

At our office, we have a private Bitbucket server. Naturally, each of our developers has accounts. The other day, we added our first submodule to our main repository. But the process has not been without its hiccups.

Particularly one thing I cannot explain is how I tell git to use the user's account when cloning the submodule. Assume our internal Bitbucket server is called bitbucket:7990 and we clone over http. Wouldn't the appropriate way to add a submodule's URL be http://git@bitbucket:7990/scm/project/repo.git?

I thought as much, since it worked on most of our machines. But on one of our developers' machine, git tried to use "git" as the account name - obviously failing, as that account doesn't exist on our system. Why didn't it use the developer's own account to clone? Like it did on the other developers' machine?

I could not spot a difference in their .git/config. Eventually, I ended up fixing it by manually inserting their account name into the submodule's URL in their config-file. But I fear the issue may come up again next time we add another submodule.

Am I handling submodules wrong? Or is there some trick I am missing?

For the record, I tried replacing the http-cloning to ssh-cloning, but it still tried to log in with the "git" account. My own config-file uses the git-account. I also tried removing the protocol, but then the : portion of the URL changes meaning, and I do not know how to specify the custom SSH port (as it noted it failed to log in on port 22).

Additionally, we are on Windows, and we are using SmartGIT as our main GUI. But using the git command directly, the same issue persisted.

Svip
  • 2,958
  • 3
  • 22
  • 33

1 Answers1

0

Turns out the solution was rather straightforward; simply remove the username all together, so the URL becomes http://bitbucket:7990/scm/project/repo.git. That seems to work.

I was inspired by this answer to a different question for the solution.

Svip
  • 2,958
  • 3
  • 22
  • 33