BookmarkSubscribeRSS Feed

How to connect SAS to your Git profile

Started ‎10-06-2021 by
Modified ‎07-25-2022 by
Views 8,819

Before you can get started using Git with SAS, you need to establish a way to connect SAS to your Git server account. The Git server might be any service that supports Git such as GitHub, GitLab, BitBucket, or others. Git services usually support two ways of authenticating a user: SSH key files in public/private pairs, or HTTPS with user/password. SAS tools such as SAS Enterprise Guide, SAS Studio, and the SAS programming language support each of these in combinations:

  • SAS Enterprise Guide supports HTTPS only
  • SAS Studio supports SSH keys, but can be configured to use HTTPS as well
  • The GIT* functions in the SAS programming language support both SSH keys and HTTPS.

(Learn more about using Git with SAS in this expert webinar.)



Git requirements for SAS Enterprise Guide

Recent updates in SAS Enterprise Guide rely on Git tools to be already installed on your Windows system. This allows SAS Enterprise Guide to run Git commands "out of process" and to leverage standard Git components. You can install Git client tools from:


If you see the error "The system cannot find the file specified" when trying to clone a Git repository, confirm that you have Git tools installed.

Creating an SSH key for use with SAS and Git

To generate a key for use with SAS Studio or SAS GIT* functions, use the ssh-keygen tool. We recommend these options:

ssh-keygen -t ecdsa -b 521 -C ""


This command will generate two files – a public and private key. For example, and id_rsa. You register the public key file with Git service you're using. And then you tell SAS (via GIT function syntax or in the Git profile for SAS Studio or SAS Enterprise Guide) where to find these key files on your local system.  You should protect the private key file (so that it's readable by your account only -- use chmod 700 on Linux systems or in Git Bash on Windows.)

Using HTTPS and Personal Access Token instead of password

Most public Git services discourage the use of user/password in third-party tools that integrate with Git. Credentials like these are easily compromised (and code assets may be valuable/highly guarded). In addition, if you enable two-factor authentication with your Git account (a best practice), you cannot use your actual password in an automated process from SAS.




You can usually create and manage personal access tokens from the account settings of whatever service you're using. These tokens can be managed to limit permission scopes, be set to expire, and can be revoked at any time. Once generated, you can use the token the same way you would use a password (in the password field of your Git profile setup in SAS).


Note that the token should still be protected carefully. Even though it's not your actual password, actions taken while using your token are done "as you" and your account permissions.


For more information about personal access tokens in GitHub (other services work similar), see the GitHub documentation.


See also

Working with Git Profiles in the SAS Studio documentation.

Using Git functions in SAS programming

Using built-in Git operations in SAS

Version history
Last update:
‎07-25-2022 09:47 AM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags