On Thu, Feb 8, 2018 at 3:11 AM Maciej Ł <labedz...@gmail.com> wrote:

> Hi! How can I cache GIT credentials in scope of a terminal session? My use
> case is the following. Me and other developers share a single account on a
> remote Linux machine. In a home directory we share a GIT project with
> application-specific configuration files. Sometimes we need to pull/push
> changes. I don't want to type my username and password every time. I also
> don't want to cache my credentials in such a way that other developers
> having simultaneous SSH sessions use my credentials to perform GIT
> operations. How can I achieve this?
>
>
If you clone over ssh (ssh://username@hostname/repopath or user@hostname:
repopath), then you can use a passphrase protected private key for that ssh
connection.  With a passphrase protected private key, only those who know
the passphrase can use it.  If you want to enter the passphrase only once
per session, you can use "ssh-agent" to remember the passphrase for the
duration of a session.

$ eval $(ssh-agent)
$ ssh-add ~/.ssh/id_rsa
$ git clone username@hostname:repopath

If you use http, you can refer to
https://help.github.com/articles/caching-your-github-password-in-git/ for
hints on "credential helpers".

Mark Waite

Maciej Ł.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to