I've written a small VCL program using Delphi CE. I want to publish the source code incl. forms on Github but I'm not sure which parts are essential to include in the repository so that others can load it in their IDE and compile it.
Asked
Active
Viewed 963 times
5
-
4You need to post the .dpr, .pas and .dfm files at a minimum. – Ken White Feb 18 '21 at 13:33
-
Exclude `*.~*` (last backup of a file being saved), `*.dcu` when their `*.pas` files exist, and `*.exe` when its `*.dpr` exists. But it doesn't hurt to publish all the files. Look at [other projects](https://github.com/search?q=delphi) which files they publish. – AmigoJack Feb 18 '21 at 13:46
-
3Include *.dproj and include *.fmx if it's a multi-platform project. – Freddie Bell Feb 18 '21 at 13:58
-
There is a list of Delphi file extensions and whether to include them in source control in the Delphi Wiki https://delphi.fandom.com/wiki/Delphi_File_Extensions – dummzeuch Feb 18 '21 at 16:39
3 Answers
8
I recommend you to use default .gitignore file for Delphi of Github. By this way you can be sure that all required files will be posted and all unnecessary files to compile will be excluded.
The file is here: https://github.com/github/gitignore/blob/master/Delphi.gitignore
If you have an existing repository and want to add a gitignore file, have a look at here: Apply .gitignore on an existing repository

sddk
- 1,115
- 1
- 10
- 20
2
You can also exclude this files:
.~
*.dsm
*.ddp
*.map
*.rsm
*.dcu
*.tds
*.local
*.identcache
*.dsk
*.stat
*.tvsconfig
Exclude too the content of directories:
__history
__recovery

Germán Estévez -Neftalí-
- 6,442
- 21
- 33
-
Useful list. I also exclude `*.dcr` and the `~` files are excluded with `*.~*` (but this might be the same). Recommend putting excluded files alphabetically to simplify maintainence! – AlainD Feb 18 '21 at 17:35
0
In addition to the other answers, some commonsense advice:
- Put whatever minimum set of files you think you need into git
- Download yourself (into a separate folder)
- See if the project builds
- If it fails, add the missing file(s) and repeat

AlainD
- 5,413
- 6
- 45
- 99