Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Git with VB6

Our company has a large codebase in VB6, and we currently use VSS which, for all that we hate about it, at least integrates into the VB6 IDE.

My own team, which is using .NET, are now looking into alternative SCMs like my personal favourite, Git. With Git Extensions, it seems we will be able to integrate Git commands into the Visual Studio IDE pretty well.

However, the question has been asked: could Git be used for our VB6 codebase too?

Of course I assume the files themselves would work fine in git repositories, but no doubt developers would complain if they had to use the command-line to do all their source control. But has anyone had any experience using VB6 and Git? Any integration available from within the VB6 IDE? Or is it perhaps not that much of a hassle to not have the IDE integration?

And do I get a badge for being the first to create the absurd tag combination of [vb6] and [git]?

like image 410
Gavin Avatar asked Mar 17 '10 13:03

Gavin


3 Answers

I found this solution to work in our situation. It adds a bit more to the previous answers and solved all of our MANY issues getting our project to work with git.

.gitattributes

# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=auto
*.bas text eol=crlf
*.frm text eol=crlf
*.log text eol=crlf
*.vbp text eol=crlf
*.cls text eol=crlf
*.vbw text eol=crlf
*.dsr text eol=crlf
*.ini text eol=crlf
*.res binary
*.RES binary
*.frx binary
*.exe binary
*.dll binary
*.ico binary
*.gif binary
*.ocx binary
*.tlb binary
*.ocx.bin binary
*.ism binary
*.bin binary
*.aps binary
*.ncb binary
*.exe.compat binary
*.ocx.compat binary

.gitignore

.DS_Store
.Trashes
*.vbw
*.csi
*.exp
*.lib
*.lvw
*.dca
*.scc
*.tmp
<name of built binary, exe, dll or ocx>
like image 97
KeithTheBiped Avatar answered Oct 22 '22 06:10

KeithTheBiped


Been using Git to manage VB6 projects for about a year now. Never came across any IDE integration. Personally I like the command line, so I've not been looking much. The two major issues I've encountered are:

  1. VB6 IDE doesn't monitor the project files, if any of them is changed externally (e.g. using 'git reset', 'git checkout') then the project needs to be re-opened to reflect the changes.
  2. VB6 IDE will sometimes change the case of event parameters or variables when loading a project, so it's never safe to use 'git commit --all' unless you want a lot of garbage with your code changes.
like image 9
Blasio Avatar answered Oct 22 '22 05:10

Blasio


You have to create the file .gitattributes to use windows line endings (crlf) because git was born in unix.

# Declare files that will always have CRLF line endings on checkout.
*.vbp text eol=crlf
*.frm text eol=crlf
*.cls text eol=crlf
*.bas text eol=crlf
*.dsr text eol=crlf
*.ini text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.frx binary
*.exe binary
*.dll binary
*.ocx binary

Also create .gitignore file with the following lines:

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.vbw
*.tmp
*.scc
*.dca
like image 8
togobites Avatar answered Oct 22 '22 05:10

togobites