git private repository access with username or password that contains the '@' character

1,339 views
Skip to first unread message

Itay Angel

unread,
May 7, 2016, 7:46:18 AM5/7/16
to git-for-windows

Hi,

I was wondering if there's a way to perform actions on a private repository using the git.exe (windows client) when my user/password contains the '@' character which is considered the host separator.


for instance I'm trying to  do the following :

git.exe ls-remote -h -t "https://username:pass@word@bitbucket.org/user/repo.git"


Thanks,

Itay.

Dirk Heinrichs

unread,
May 9, 2016, 1:49:29 AM5/9/16
to git-for...@googlegroups.com
Am 05.05.2016 um 09:45 schrieb Itay Angel:

for instance I'm trying to  do the following :
git.exe ls-remote -h -t "https://username:pass@wo...@bitbucket.org/user/repo.git"

You could
  • omit the PW and enter it at the prompt
  • try to escape the @: \@
  • use SSH with a key instead of HTTPS
HTH...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Dirk Heinrichs

unread,
May 9, 2016, 1:51:51 AM5/9/16
to git-for...@googlegroups.com
Am 09.05.2016 um 07:49 schrieb Dirk Heinrichs:

Am 05.05.2016 um 09:45 schrieb Itay Angel:

for instance I'm trying to  do the following :
git.exe ls-remote -h -t "https://username:pass@wo...@bitbucket.org/user/repo.git"

You could
  • omit the PW and enter it at the prompt
  • try to escape the @: \@
  • use SSH with a key instead of HTTPS

Oh, and of course
  • change that PW :)

Bye...

Lars Schneider

unread,
May 9, 2016, 3:21:16 PM5/9/16
to Itay Angel, git-for-windows
Hi Itay,

I assume you want to use it for scripting and an additional line does not matter? You could try this:


printf -v HELPER "!f() { cat >/dev/null; echo 'username=%s'; echo 'password=%s'; }; f" "$YOUR_USER" "$YOUR_PASSWORD"
git -c credential.helper="$HELPER" ls-remote -h -t "https://bitbucket.org/user/repo.git"

Cheers,
Lars
> --
> You received this message because you are subscribed to the Google Groups "git-for-windows" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to git-for-windo...@googlegroups.com.
> To post to this group, send email to git-for...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/git-for-windows/765de210-b658-4e3a-8b1c-6763255406f9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages