Git: Enter username when updating submodules

I'm cooperating with another one called B, and he adds a submodule to our git repository. When I want to update it, I see this .gitmodules:

[submodule "mod"]
path = mod
url = https://B@serverurl/path/modr.git

I can modify this file to myname@serverurl, commit and push it, run git submodule sync, but it's incredibly stupid. Can't I just leave the username blank and input username each time?

Thanks.

Upvotes: 0

Views: 86

Answers (1)

trygub
trygub

Reputation: 87

Username in url is optional. You can instruct each developer NOT to check in their username in .gitmodules and specify it via other means instead. E.g., username can be provided using .netrc file.

Upvotes: 1

Related Questions