Tech Articles


Git for a single developer


Let's say you're an independent contractor or a one person shop.  You want to take advantage of the source control features of Git, but you don't want to have to set up a server just for one developer.  Fortunately, you don't have to.  We're going to walk through the steps of connecting PowerBuilder to a local directory based repository.

Step 1.  Create a new folder

Nothing tricky here, just create a new folder to hold the repository.  For this example, I'm going to name it "local_repository"

Step 2.  Create a "bare" Git repository using the new directory.

I'm going to use TortoiseGit here because it's what I'm familiar with, but you can perform the same operation using the Git client command line.

Make sure that you check the option to create a "bare" repository.  If you don't, you won't be able to push to it.  Non-bare repositories are typically working repositories (cloned).  You need a bare repository so that you can push to it.

Step 3.  Create a share for the repository folder

We're going to need to be able to access the repository using a network reference, so we need to create a network share.

Step 4.  Connect the PowerBuilder workspace to Git

Remember that the repository won't come into play until we attempt to push.  For now, the connection to Git is just to a local working repository that PowerBuilder creates for it's own use

Select "Add to Source Control" from the RMB menu on the workspace

Select Git as the source control system to connect to

Provide a name and email address that Git will associated to your code changes

Do the initial commit of your PowerBuilder code to the local working repository

Step 5:  Push and configure the connection to the bare repository

From the workspace RMB, select Git Push

Here's the step where the bare repository comes in.  You'll be prompted for a Git login.  Instead of a http or https url reference, provide a network share reference (e.g., \\server_name\share_name).  In this example I'm connecting to a folder on the same machine, so I'm using localhost for the server name.  Provide at least a User ID, and then hit "Test Connection" to ensure you've configured it correctly.  Then press OK.

 

You should see the locally committed source code pushed to the bare repository.

At this point you can do all the same operations with the bare repository that you would with a Git server.   However, TortoiseGit (which is a client application) isn't set up to perform operations such as creating branches.   For that, you'll need to use the git command line.  For an example of how to do that, and for a good overall introduction to the git command line, see https://githowto.com/creating_a_branch

 

 

 

 

Comments (1)
Friday, Mar 26 2021

Nice article, thanks Bruce !

0

Find Articles by Tag

SOAP Event Handler Windows OS Window DragDrop DLL Application .NET Assembly Authentication Automated Testing Transaction SnapDevelop Visual Studio Resize Interface OrcaScript Deployment Encoding Installation Event PBNI InfoMaker Database Painter JSONParser HTTPClient API COM Database Table Data OAuth Syntax Database Table Schema Script Open Source RibbonBar Builder Platform PostgreSQL Database Connection License Messagging Sort Charts Export JSON Elevate Conference Variable PowerServer Mobile CI/CD iOS CrypterObject PowerBuilder (Appeon) PFC Error PBVM Migration Performance GhostScript TLS/SSL Export Authorization IDE Azure SqlModelMapper Import Text ActiveX File RibbonBar Windows 10 Icons Design DataWindow Source Control Android Model Array 64-bit UI Modernization ODBC External Functions PowerScript (PS) PBDOM SQL SDK DevOps SQL Server SnapObjects TreeView PowerServer Web Database Object Filter Expression Web Service Proxy Oracle Web API Repository TortoiseGit Configuration WebBrowser SqlExecutor Source Code JSONGenerator .NET DataStore Graph 32-bit OLE Debug Bug Testing Trial PDFlib Stored Procedure Event Handling Data RichTextEdit Control Branch & Merge Mobile NativePDF Class REST Debugging DataWindow JSON DataType MessageBox BLOB Outlook Debugger Import JSON Validation OAuth 2.0 TFS Service RESTClient Icon Git WinAPI Excel Jenkins PostgreSQL ODBC driver UI Themes XML Menu PowerBuilder Compiler UI C# PDF PowerBuilder CoderObject SVN JSON Database .NET Std Framework Linux OS Database Table Database Profile Encryption