-
Notifications
You must be signed in to change notification settings - Fork 56
E001
By default, GitHub offers you an https URL for initially cloning a repository. When you try to push to a repository cloned this way, git will ask you for your username and password to push. This is not a big deal if you are doing a one-off push by hand, but when running ghstack we do a lot of git pushes (up to three times the number of PRs in your stack), and continuously re-entering your password every time can be quite tiresome.
In recent versions of ghstack, we have disabled interactive password authentication for git push, so we will just fail if this situation occurs. To fix this, you will need to setup password-less push. There are a few ways to do this:
-
Recommended! Change your upstream git repository to use SSH instead of HTTPS. Open
.git/config
and look for a section under[remote "origin"]
that looks likeurl = https://github.com/$USER/$REPO.git
. Change this tourl = [email protected]:$USER/$REPO.git
. If you have never used SSH to interact with GitHub on this machine before, you will also need to setup an SSH key; follow the instructions at https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account - You can add a
pushurl
which will make SSH only be used for pushes, and HTTPS be used for pulls. - You can cache your HTTPS username/password, e.g., following the instructions at https://stackoverflow.com/questions/35942754/how-can-i-save-username-and-password-in-git
If for some reason, you want to manually reenable the old behavior, explicitly set GIT_TERMINAL_PROMPT=1
environment variable when running ghstack.