2

I am working on a private repo hosted on IBM-jazz.

First, when I wanted to clone this repo, I had to type the following command:

git clone https://user_name:password@hub.jazz.net/git/repo_owner/repo_name

When doing:

git remote show origin

It shows my credentials...

Is there anyway to prevent this from happening?

Omar Lahlou
  • 1,000
  • 9
  • 33
  • You could leave the password off, but you'd have to type it in every time you fetch, push or pull. The best solution is not to use HTTPS at all, do git over SSH instead. – Collin Oct 29 '15 at 17:03

1 Answers1

0

You can omit the credentials and use the git credential cache to cache them in memory and ease the pain of typing them. You can even store the credentials on disk, but keep in mind that this will store the password in plain-text.

A possible configuration (taken from here) for caching the credentials for 5 minutes would be:

git config credential.helper 'cache --timeout=300'
kubanrob
  • 160
  • 2
  • 8