BookmarkSubscribeRSS Feed

How to connect SAS to your Git profile

Started ‎10-06-2021 by
Modified ‎07-30-2024 by
Views 11,924

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.

 

git-connect.png

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.  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.

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 "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.)

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 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.

 

gitaccesstoken.jpg

 

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.

 

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-30-2024 01:01 PM
Updated by:
Contributors

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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