If your local PowerBuilder workspace/solution has not been added to the Git source control system before, you can add the entire workspace/solution to Git from the PowerBuilder IDE. To add a workspace/solution to Git, you do it in two steps:
Step 1: You upload the workspace/solution to the repository on your local computer.
Step 2: You push the workspace/solution from the local repository to the remote repository on the Git source control server.
Below are the complete steps.
To add a PowerBuilder workspace/solution to the Git source control system:
-
Right-click the workspace/solution in the System Tree and select Add to Source Control from the pop-up menu.
-
In the Add to Source Control dialog box, select Git as the source control provider for the current workspace/solution and click OK.
-
In the Author Information dialog box, input the author name and author email.
For the workspace, you can also specify the encoding format for the source code files in "ws_objects". You can select from: ANSI/DBCS, HEXASCII, and UTF8.
After clicking OK, the Add to Source Control dialog box displays listing all the files for the workspace/solution that are not currently under source control. You cannot add files that are already under source control.
For the workspace, a "ws_objects" sub-folder is automatically created under the workspace, for managing the source code file of the PowerBuilder objects including .srw (for window), .srm (for menu), .sru (for user object), .srd (for DataWindow), etc. The "ws_objects" folder must be added to the source code, in order to manage the source code at object level. (For the solution, there is no "ws_objects" sub-folder created.)
-
In the Add to Source Control dialog box, select the files and folders (and also ws_objects if it is a workspace) and click OK.
PowerBuilder adds the selected files and folders to the repository on your local computer. After the file or folder is added to the local repository, the object in the PowerBuilder System Tree will be marked with a green dot (
) in front of it, indicating that its source code file on the local computer is in sync with the file on the local repository. Now you can proceed to push the objects from the local repository to the remote repository on the Git source control server.
Note
When you add files to the Git source control server, and encounter the following error, you can follow instructions in the section called “Failed to add files to Git repository” in PowerBuilder Troubleshooting Guide to resolve the error.
Git detail error info: Repository path 'C:/Users/Public/Documents/Appeon/PowerBuilder 25.0/Code Examples/Example Sales App/' is not owned by current user Git client error code: -36 Failed to add files to repository.
-
Right-click the workspace/solution in the System Tree and select Git Push from the pop-up menu.
-
In the Git Login dialog box, input the information required by the source control system. If the login information has been input before, they will be filled in automatically.
In the Repository URL box, input the URL of the Git server and the repository for the workspace/solution. Make sure the repository with the same name exists on the server and the repository is empty before you push the files.
The name of the current workspace/solution is automatically displayed in the Workspace/Solution File field.
Select Basic or Token from the Authentication Type list.
In the User ID and Password (or Personal Access Token) boxes, type in your user name and password (or token) for the Git source control system.
Click Connect to make sure connection is successful and then click OK.
Note
If your user name or password/personal access token is incorrect, you will be displayed with a third-party log-in window to directly authenticate your user credentials with the Git server. If authentication is successful, your user name and password or personal access token will be automatically filled into the Git Login dialog box. For more information, see authenticate your user credentials with the Git server.
Note
If using the proxy server, configure the proxy server IP address and port number in the PB.ini file. See Using proxy server for more information.
PowerBuilder pushes the selected objects to the Git source control system.
"Reference was not fast-forwardable" error when pushing to Bitbucket
When adding the workspace/solution to the Bitbucket server using "Git Push", you may come across the "Reference was not fast-forwardable" error, if the repository on the Bitbucket server is created with a readme (the "Include a README" option set to "Yes, ..."). To resolve this error, you can first execute a "Git Pull" (to synchronize the server repository with the local repository) and then execute "Git Push" again.