Using Git with VB6

前端 未结 7 577
轻奢々
轻奢々 2020-12-05 08:00

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 u

相关标签:
7条回答
  • 2020-12-05 08:22

    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.
    0 讨论(0)
  • 2020-12-05 08:24

    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
    
    0 讨论(0)
  • 2020-12-05 08:26

    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>
    
    0 讨论(0)
  • 2020-12-05 08:32

    What's so different about VB6 as a code base (i.e. text files) that makes it not suitable for git?

    The culture is another matter altogether: if you have plenty of incompetent developers who can't handle the command line, the cure would probably include running away from VB6 as far as you can.

    The only potential problem is that windows in the git world is somewhat of a second class citizen. You might wanna try bazaar or mercurial if you find git doesn't work very well in your environment.

    0 讨论(0)
  • 2020-12-05 08:36

    We are doing this. We have added the following to .gitIgnore

    • *.csi
    • *.exp
    • *.lib
    • *.lvw
    • *.vbw
    • MyProject.dll
    0 讨论(0)
  • 2020-12-05 08:37

    You know your developers best. Will they mind using the command line? Are they keen on IDE integration? These are personal preferences.

    Make sure the most respected developers understand the benefits of git and are behind the decision.

    Do be aware that some VB6 source files are binary and shouldn't ever be merged: e.g. .frx files. I don't know git, so I don't know whether that's a problem.

    0 讨论(0)
提交回复
热议问题