Create a local branch with the same name as the remote branch. Checking Out Branches For example "dev" if you have remote branch "origin/dev". Checkout newly created local "dev" branch. Then when you pull changes it puls form remote "origin/dev". data _null_;
version = gitfn_version();
put version=;
run;
%let l_git_repo = 'C:\Git\xxxxxxx';
%let l_git_uri = 'https://?????/xxxxxxx.git';
%let l_git_user = '???????';
%let l_git_pw = '{SAS005}???????';
/* Delete REPO */
data _null_;
rc = GITfn_DEL_REPO(&git_repo.);
put rc=;
run;
/* Clone Repo */
data _null_;
rc = GIT_CLONE (&l_git_uri., &l_git_repo., &l_git_user., &l_git_pw.);
put rc=;
run;
/* Get Branch commit id from remote*/
%let l_git_branch = 'dev';
%let l_git_branch_commit_id = NA;
data _null_;
infile %sysfunc(quote(%sysfunc(dequote(&l_git_repo.))/.git/refs/remotes/origin/%sysfunc(dequote(&l_git_branch.))));
input;
call symputx( 'l_git_branch_commit_id',quote(cats(_infile_)),'l');
stop;
run;
%put &=l_git_branch_commit_id.;
/* create new local branch */
data _null_;
rc = git_branch_new(&l_git_repo., &l_git_branch_commit_id., &l_git_branch., 0);
put rc=;
run;
/* chkout local branch */
data _null_;
rc= git_branch_chkout(&l_git_repo.,&l_git_branch. );
put rc=;
run;
/* pull changes */
data _null_;
rc= git_pull(&l_git_repo., &l_git_user., &l_git_pw.);
put rc=;
run;
... View more