Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 2.07 KB

github.rst

File metadata and controls

51 lines (36 loc) · 2.07 KB

Using GitHub at NSLS-II

Two-factor authentication

We strongly recommend securing your account with two-factor authentication.

For normal use from the campus network, the most convenient way to access GitHub is using SSH. See GitHub's SSH guide. Your remotes will look like:

$ git remote -v
danielballan   [email protected]:danielballan/bluesky (fetch)
danielballan   [email protected]:danielballan/bluesky (push)
origin         [email protected]:bluesky/bluesky (fetch)
origin         [email protected]:bluesky/bluesky (push)

Note [email protected]: in place of where you might have https://github.com/. You can update a remote using

$ git remote set-url <NAME> <NEW_URL>

For use inside the ring, connecting via SSH does not work. (Consult ITC to ask why.) Your best option is to use a personal access token, which you can do at github.com/settings/tokens or by following GitHub's token guide. You can then paste the token into a file in your home directory. Make sure to restrict the permissions with chmod 600 path/to/file_with_token or any user will be able to read it and log into GitHub as you!

To use the token, set the remote urls in the HTTPS style (not [email protected]:). When you try to push you will be prompted to enter your username. After entering the username, you will be prompted to enter your password. Paste the token in instead.

You can also add the beamline workstation as remote on your machine (assuming you have your ssh config set up correctly):

git remote add <NAME> git+ssh://<BL_MACHINE_NAME>/<PATH_TO_REPO>

which will allow you to pull from the beamline machine to your machine and then push back out to GitHub.