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 methods.
Learn more about using Git with SAS in this expert webinar.
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. Starting with SAS Enterprise Guide 8.3, SAS Enterprise Guide uses the authentication method that is used by your local Git installation, including HTTPS and SSH. You can install Git client tools from: https://git-scm.com/.
If you try to use Git in SAS Enterprise Guide and see the error "The system cannot find the file specified" when trying to clone a Git repository, confirm that you have Git tools installed.
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 "your_email@example.com"
This command will generate two files – a public and private key. For example, id_rsa.pub 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.)
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 or single-signon with your Git account (a best practice and for some systems it's a requirement), 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. In recent versions of SAS Studio, you can protect your password/token by configuring an authentication domain. See the SAS Studio documentation for more information.
For more information about personal access tokens in GitHub (other services work similar), see the GitHub documentation.
Working with Git Profiles in the SAS Studio documentation.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.