0% found this document useful (0 votes)
75 views

Windows - How Should I Properly Use Git For Visual FoxPro Development - Stack Overflow

Git can be used for version control of Visual FoxPro projects with some adjustments. Files like .prg files can be tracked normally in Git, but .scx and .vcx files need to be converted to XML for tracking changes at the file level instead of the whole file. A tool called VfpScm can convert these file types to and from XML to integrate them with Git version control while preserving file differences. Developers should add .prg files, convert classes and forms to XML with VfpScm, commit changes, and push to a shared repository for collaboration.

Uploaded by

rtfm pliz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Windows - How Should I Properly Use Git For Visual FoxPro Development - Stack Overflow

Git can be used for version control of Visual FoxPro projects with some adjustments. Files like .prg files can be tracked normally in Git, but .scx and .vcx files need to be converted to XML for tracking changes at the file level instead of the whole file. A tool called VfpScm can convert these file types to and from XML to integrate them with Git version control while preserving file differences. Developers should add .prg files, convert classes and forms to XML with VfpScm, commit changes, and push to a shared repository for collaboration.

Uploaded by

rtfm pliz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

How should I properly use Git for Visual FoxPro Development?

Asked 9 years, 8 months ago Modified 5 years ago Viewed 5k times

I'm a Git beginner. I'm reading and trying out this Git tutorial. And I have also read the Git branching model
here and this question on SO.
2
But I'm still confusing how I should use Git properly for my case below:

1. I have a project MyProject01 . I will be working on it from a PC, says PC01

2. Another developer sitting on another PC, says PC02, will clone the project MyProject01 (git clone, git
pull, etc.) and then will be working on it.

3. Then, those two will be synchronized (probably git push to PC01, but I'm not sure of that). For example,
I'm working on file.prg on PC1 to write function 1 while another developer is working on the same
file file.prg on PC2 to write function 2 . Those will be merged to get the final outcome - file.prg
with function 1 and function 2 done.

I'm not using Git as full version control, i.e., the version will be controlled by myself such as MyProject01 ,
MyProject02 , etc. Git will be using ( git init ) for each individual directory. I just want to use Git as multi-
developer environment for my Visual FoxPro desktop application development.

According to my case, do I need to create a bare repository cloned from repo01 as described in the tutorial;
repo01 would be MyProject01 ?

I think I'm not suitable with the branching model described above. Please guide me to the right way.
I'm using the Git installer for Windows.

[Edit]
My primary goal is to use Git as Source Control similar to:

Source Control Software in Visual FoxPro

CVS, SubVersion and Visual FoxPro

VFP Version Control with Mercurial

windows git visual-foxpro

Share Improve this question Follow edited May 23, 2017 at 12:00 asked Aug 14, 2013 at 6:52
Community Bot Sithu
1 1 4,702 9 64 109

After reading the PDF VFP Version Control with Mercurial, I decided to use Mercurial and TortoiseHg because (1) the
documentation which meets my requirement of VFP 99% (2) well integration with the Windows shell (3) good and user-
friendly GUI tool. The question was originally for Git, but I did not find any step-by-step guide of Git to use with VFP. And
I found a question and answers that are very helpful for me to choose Mercurial over Git. –  Sithu Apr 8, 2015 at 3:20

Sorted by:
4 Answers
Highest score (default)

I know this is a 10 months question, but surely this could be useful anyway.

5 From january 2014 there is a new replacement for scctext(x).prg called FoxBin2Prg, which can convert VFP 9
binaries to text (prg style ones) and can regenerate the binaries from this texts. Can be used to Diff and
Merge code and the generated text can be modified, and the changes reflected on the regenerated binaries.

It is hosted on VFPx Project, at this url: https://github.com/fdbozzo/foxbin2prg

Actually I'm using it integrated with PlasticSCM in a 10 members team without the need of blocking files,
using concurrent development even on the same forms and classes.

Best regards!

Share Improve this answer Follow edited Apr 5, 2018 at 18:33 answered Jun 16, 2014 at 21:51
Fer B.
406 5 10

I'm not using Git as full version control, i.e., the version will be controlled by myself such as
MyProject01, MyProject02, etc. Git will be using (git init) for each individual directory
2

Why bother with git then, if you're just going to throw away old histories?

If you don't want histories, then diff and patch will serve you just as well. In git, in addition to having multiple
branches in a single repository, you can also create multiple working copies by cloning the repository. Having
multiple branches allow you to preserve histories from previous versions while also allowing you to go back
to a previous version and make modifications; having multiple working copies allows you to run multiple
versions of the program simultaneously or store files that were not checked in but is version specific (e.g.
sqlite database file). There is no reason to reset revision history every time you create a new version.

(probably git push to PC01, but I'm not sure of that)

Yes, you can do that because in a DVCS you can push or pull from any repository to any repository (this is
what differentiates distributed VCS from centralized VCS, the other main difference is that in DVCS a working
copy is always also a repository with full history instead of just a snapshot of a specific revision). With that
said, setting up a bare repository is still a good idea to make code sharing easier. If PC02 need to push but
PC01 isn't online, then PC02 would have to wait until PC01 is online to be able to push, a bare repository on a
server that is always online wouldn't have that problem.
Share Improve this answer Follow answered Aug 14, 2013 at 7:24
Lie Ryan
61.3k 13 99 143

Thank you for your answer. I'm not going to throw away old histories. Currently, I do it manually, i.e., after I have released
1.0 and I'm going to work on 2.0, I clone the folder MyProject-1.0 and name it into MyProject-2.0 . Same for every
single file in the project folder. So, I have every old history. I just want to use Git for synchronizing and merging among
copies. I'll keep my self-control version style. May be I use Git version (tag) for individual files in the project folder. Am I
on the right track using Git for that purpose? –  Sithu Aug 14, 2013 at 8:19

Same for every single file in the project folder <- what do you meant by that? As to your other question,
you can certainly use git just for sync and merge, git itself doesn't endorse nor prohibit any specific workflow; but you're
missing an awful lot of power for no obvious reason. – Lie Ryan Aug 14, 2013 at 8:25

Same for every single file in the project folder <- I mean that I have utility-1.0.prg in my project
folder and when I want to make an update in that file, I copy the file and rename it to utility-2.0.prg . I'm using this
way since last 6 years. So, it is difficult for me to move completely into the Git awful should-be workflow for all of my
existing projects. –  Sithu Aug 14, 2013 at 8:37

As my team is sitting and working in an office, we can work simultaneously on the server for a web project, except that
we cannot edit the same file at the same time. So we don't need such git pull/push/clone in our web development.
But for desktop development, I need this clone/pull/push to have each copy for each developer since the same
project cannot be opened simultaneously. –  Sithu Aug 14, 2013 at 8:50

@Sithu: yes, that's what I feared. You lose the benefit of keeping history that way. You can't git bisect, can't git blame,
can't get a git diff across versions, can't git cherry pick, you don't have a proper way to fix issues on an old version. Your
workflow, while doable in git, is no better off than just using patch and diff. You're doing things the hard way. Some
things need to change and sometimes that thing is you. – Lie Ryan Aug 14, 2013 at 9:15

Check https://github.com/sait/vfpscm

2 PRG files are just plain text, you can use GIT or Mercurial with them transparently.

You have problem with Visual Forms (scx & sct) and Visual Classes (vcx & vct) because those files are DBF
tables with a memo file associated; when you modify a form, it change the whole file.

GIT can handle binary files perfectly, but you would not see the diferences in code, and that whats SCM is for.

We create this program: https://github.com/sait/vfpscm that:

1. Convert your Forms and Classes to XML so you can push them in repository and when you modify the
form, only change a few lines in the XML file.

2. Reconvert XML files to Forms and Classes, to receive that changes.

So the process of using regular GIT change to this:

1. Edit Files PRGs

2. Edit Visual Classes and Forms

3. Testing
4. Once your bug is fixed or feature is ready:

5. Convert classes and forms to XML (running VfpScm)

6. Add files PRGs and XMLs to your Git (git add)

7. Commit file (git commit -m "messages")

8. Push changes to repository (git push -u origin master)

Your team would need to pull these changes and add them to their local copy with:

1. Pull changes (git pull origin master)

2. PRG and XML would be overwrited by Git

3. Rebuild Forms and Classes that has been changed (running VfpScm)

GIT is configure to ignore SCX, SCT, VCX and VCT files using .gitignore and the repository only contains PRG
and XMLs files

We have been working with VFPSCM.exe tool since 5 years in large projects with 300 forms and 20 classes,
and we have never loose any code, and the must important we have the SCM ready, visualizing only the
changes made, and a history of commits, that convert in our logbook of changes.

Share Improve this answer Follow answered Feb 16, 2015 at 14:13
Ignacio Gutiérrez Torrero
37 3

You can use Git for multiple projects. Create two folders for project1 and project2 and keep them separate
from each other.
0
Try to use SmartGit in the start.

Git is not a traditional source control system. It is distributed source control system. I would still suggest you
to start with a GitUI in the beginning.

Yes you should have a bare repository.

Share Improve this answer Follow answered Aug 14, 2013 at 6:58
user2483744
283 1 5 11

1 Thank you for your suggestion of SmartGit. I'm still OK with Git Bash. –  Sithu Aug 14, 2013 at 8:40

2 I strongly recommend against using a GUI with Git, even for beginners, because they abstract away too much
knowledge about how Git actually works. If anyone, including beginners, wants to learn and become proficient in Git,
then they must learn to use it from the command line. – user456814 Aug 14, 2013 at 12:16

You might also like