IBM i

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
 View Only

Unlocking Modern Development on IBM i with GitHub

By Nirmal Khatri posted 23 days ago

  

GitHub is one of the leading collaboration platforms for modern software teams, providing Gitbased version control, streamlined code review, automations (CI/CD), and security tooling.

                

Integrating GitHub into your IBM i workflow connects traditional IBM i development with contemporary engineering practiceswithout compromising the reliability IBM i is known for.

                                  

Why pair GitHub with IBM i?

                                       

·       Version control you can trust. Git tracks every change, by whom and when, and lets you revert confidently.

·       Highquality collaboration. Pull requests, reviews, and protected branches improve quality and reduce conflicts.

·       Builtin security. GitHub code scanning and dependency alerts help surface issues early.

·       Automation with CI/CD. GitHub Actions can build, test, and deploy IBM i artifacts to increase speed and consistency.

                       

Prefer GitLab or another Git hosting platform? The core concepts are identical.

                                           

Pre-requisites

·       A GitHub account with organization/repository access.

·       IBM i Access Client Solutions (ACS) for package management.

·       Shell access on IBM i.

                      

Getting Started: Setting up Git on IBM i

Before you begin, you need to have Git installed on your IBM i system and a GitHub account.

                                      

1.     Step-by-step installation:

·       Open Access Client Solutions (ACS): Go to the "Tools" option and select "Open-Source Package Management."

            

·       Log In: Use your IBM i credentials to log in.

                    

·       Install Git: In the "Available packages" window, search for "git" and click "Install."

·       Run Qshell: After installation, run the command CALL QP2TERM to open the Qshell interface.

                

·       Set the Path: To make Git commands available permanently, add the Git bin directory to your path. Run the following command:

echo 'PATH=/QOpenSys/pkgs/bin: $PATH'>> $HOME/. profile && echo 'export PATH'>> $HOME/. Profile

·       If you do not have a user home directory, create one first by running:

mkdir /home/USERNAME && touch /home/USERNAME/.profile.

                              

·       Verify Installation: Restart your session, run CALL QP2TERM again, and then type git -version to confirm Git is installed correctly.

                              

A screenshot of a computer

AI-generated content may be incorrect.

                            

2.     Generating an SSH Key

For secure authentication with GitHub, you need to generate an SSH key pair.

·       Generate the Key: Run the following command, replacing the email with your own:

ssh-keygen -t rsa -b 2048 -C "email@example.com"

                             

·       View the Key: Display your public key by running:

cat /home/user/.ssh/id_rsa.pub

                    

·       Add Key to GitHub: Copy the key from the output.

Log in to your GitHub account, go to "Settings," then "SSH & GPG keys." Click "New SSH key," paste the key you copied, and give it a descriptive name.

                                               

image

                  

·       Start SSH Agent: In your Qshell session, start the SSH agent with eval "$(ssh-agent -s)" and add your key to it with ssh-add ~/.ssh/id_rsa.

                    

·       Add GitHub to Known Hosts: To prevent security warnings, add GitHub to your list of known hosts by running:

ssh-keyscan github.com >> ~/.ssh/known_hosts

                                                                                        

3.     Cloning and Working with a GitHub Repository

Now you can start working with a repository. You can use your existing repository on GitHub or create a new one.

                        

·       Clone the Repository: On GitHub, find the repository you want to use, click on the "Code" button, and copy the SSH path. Then, in your IBM i Qshell, run the command:

git clone <PATH>.

This will create a local copy of the repository on your IBM i system.

                        

·       Copy Your Code: Use the CPYTOSTMF command to copy your IBM i source member (your code file) into the cloned repository directory. For example:

CPYTOSTMF FROMMBR('/QSYS.LIB/YOURLIB.LIB/YOURFILE.FILE/YOURMEMBER.MBR')

             TOSTMF('YOUR_DIRECTORY_PATH/YOUR_CODE_FILE.txt') STMFOPT(*REPLACE) DBFCCSID(*FILE)

             STMFCCSID(1252) ENDLINFMT(*LF) AUT(*DFT)

                               

4.       Add, Commit, and Push: In the Qshell, navigate to your repository's directory.

·       git add . to stage all changes.

·       git commit -m "Your commit message" to save the changes.

·       git push to upload your changes to GitHub.

                                     

5.     Pulling Changes from GitHub

If others have made changes on GitHub, you can pull them down to your IBM i system.

·       Pull Changes: In your Qshell, simply run the command git pull. This downloads the latest changes from the GitHub repository.

                             

·       Copy Back to IBM i: Use the CPYFRMSTMF command to copy the updated file from your Git directory back into your IBM i source member.

CPYFRMSTMF FROMSTMF('YOUR_DIRECTORY_PATH/YOUR_CODE_FILE.txt')

 TOMBR('/QSYS.LIB/YOURLIB.LIB/YOURFILE.FILE/YOURMEMBER.MBR') MBROPT(*REPLACE)

 ENDLINFMT(*LF)

By following these steps, you can start using GitHub to manage your IBM i code, enabling a more collaborative and efficient development process.

                       

Conclusion

Bringing GitHub into your IBM i ecosystem modernizes collaboration, governance, and delivery—without sacrificing the platform’s strengths. Whether you are building net‑new applications or incrementally modernizing, adopting Git‑based workflows (with SSH auth, UTF‑8 files, and CI/CD) will help your teams move faster with confidence.

0 comments
9 views

Permalink