From 6d8b49970b84ce2f3473d8f2bc72a05cb6a38c8b Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Wed, 20 May 2020 12:04:23 +0200 Subject: [PATCH 1/8] update article --- pages/v4/Duality-and-Version-Control.md | 77 ++----------------------- 1 file changed, 6 insertions(+), 71 deletions(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index ee603fb..d919ba8 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -15,7 +15,7 @@ Let's start this article with some general words of advice, in case you are not Think of it as a sophisticated backup and collaboration strategy. When working on a project, you will gradually introduce changes. Most of the time, these changes will be done in several work sessions, and after a few sessions, you might decide to make a backup to have a safe haven to return to, should any of your future changes screw something up. -Version control systems are a way to automate your workflow and organize all versions of all the files in a certain place, so you don't have to bother. On top of that, they are also able to do things that would require a tremendous organization effort otherwise, such as merging two different versions of your project after you and a colleage have worked on it independently for a while. +Version control systems are a way to automate your workflow and organize all versions of all the files in a certain place, so you don't have to bother. On top of that, they are also able to do things that would require a tremendous organization effort otherwise, such as merging two different versions of your project after you and a colleague have worked on it independently for a while. ## Why Should You Use Version Control? @@ -54,84 +54,19 @@ Of course there are more than those two, and the choice is yours. The most impor # Version Control in Duality -If you're an experienced version control user, you know that you sometimes need to be careful which files to add to the system, and which ones to keep out of it. In fact, adding _all_ files of a Duality project to version control would be an incredibly wasteful thing to do. It's always good to keep your repository nice and clean, with only the essential files persistently versioned, while keeping out redundancy and temp noise. +If you're an experienced version control user, you know that you sometimes need to be careful which files to add to the system, and which ones to keep out of it. In fact, adding _all_ files of a Duality project to version control would be an incredibly wasteful thing to do. It's always good to keep your repository nice and clean, with only the essential files persistently versioned, while keeping out redundancy and temp noise. In v4 duality made this easier to achieve because all binaries are now deployed from the project files in your solution so its no longer needed to put these under source control. ## Duality as a Self-Installing Application -When you initially downloaded and installed Duality, you may have noticed that there was no dedicated installer software, but a stripped-down version of the Duality editor itself. Running it for the first time, it started to download all the required packages, copied them into place and restarted itself to apply the update. +When you initially downloaded and installed Duality, you may have noticed that there was no dedicated installer software, only a solution file with some projects. Building it for the first time will download all the required packages and copies them into place. After this you can run Duality. -This is not a one-off operation - if you delete all files except for the ones that came with the download, Duality will re-install itself and all packages in the exact version they were present before. We can use this behavior to keep our version control repository clean of most binaries, while at the same time making sure that a checkout is all that is needed for opening and running your Duality project. +This is not a one-off operation - if you delete all files except for the ones that came with the download, you can simply build Duality again to restore these files. We can use this behavior to keep our version control repository clean of all binaries. ## The Initial Setup Commit In the initial commit of your project, you will spend a lot of time adding files to your version control systems ignore list. Let's go through the most important files and folders to ignore, and see _why_ they should be ignored: -- `Source/Packages` is where Duality package management caches local copies of each package before copying them to their proper folder in the main directory. If any package that should be installed isn't represented in this directory, it will be re-installed. Since this is exactly what we want, this folder should not be version-controlled, so new checkouts won't have it. -- `Source/Code/../bin` and `Source/Code/../obj` are the output and intermediate folders for building your game plugins. There is a post-build step that copies the binaries over to `Plugins` where they need to be, so we don't need either of those folders. Ignore! +- `**/bin` and `**/obj` are the output and intermediate folders for building your game. There is a post-build step that copies the binaries over to the root Duality folder and the `Plugins` folder where they need to be, so we don't need either of those folders. Ignore! - `Plugins` (the entire content, not the folder) except for the game and editor plugin files that you build yourself from the `Source` folder. Adding them to version control means a few megabytes of extra data, but it can pay off for the added convenience of not having to build the source code after checkout just to start the game or run the editor. - `Backup` because that's what our version control system already does. -- All files from the main folder that are not part of the Duality download package, as they're auto-installed on first launch after checkout. The only exception are the files `DefaultUserData.dat` and `AppData.dat`, which should not be ignored. - -### Example Git Ignore File - -If you're using **git**, here is a sample `.gitignore` file for you to start with. - -``` -YourProjectFolder/Source/Packages/ -YourProjectFolder/Backup/ -YourProjectFolder/Temp/ -YourProjectFolder/Plugins/* -!YourProjectFolder/Plugins/GamePlugin.core.dll -!YourProjectFolder/Plugins/GamePlugin.core.pdb -!YourProjectFolder/Plugins/GamePlugin.core.xml -!YourProjectFolder/Plugins/EditorPlugin.editor.dll -!YourProjectFolder/Plugins/EditorPlugin.editor.pdb -!YourProjectFolder/Plugins/EditorPlugin.editor.xml -YourProjectFolder/NVorbis.dll -YourProjectFolder/OpenTK.GLControl.dll -YourProjectFolder/OpenTK.GLControl.xml -YourProjectFolder/OpenTK.dll -YourProjectFolder/OpenTK.dll.config -YourProjectFolder/OpenTK.pdb -YourProjectFolder/OpenTK.xml -YourProjectFolder/FarseerDuality.xml -YourProjectFolder/FarseerDuality.pdb -YourProjectFolder/Microsoft.Web.XmlTransform.dll -YourProjectFolder/NVorbis.XML -YourProjectFolder/FarseerDuality.dll -YourProjectFolder/EditorUserData.xml -YourProjectFolder/PopupControl.dll -YourProjectFolder/PopupControl.pdb -YourProjectFolder/DualityUpdater.exe -YourProjectFolder/DualityPrimitives.pdb -YourProjectFolder/WeifenLuo.WinFormsUI.Docking.dll -YourProjectFolder/WeifenLuo.WinFormsUI.Docking.pdb -YourProjectFolder/logfile.txt -YourProjectFolder/logfile_editor.txt -YourProjectFolder/logfile_editor_prev.txt -YourProjectFolder/perflog.txt -YourProjectFolder/Aga.Controls.dll -YourProjectFolder/Aga.Controls.pdb -YourProjectFolder/Duality.pdb -YourProjectFolder/Duality.xml -YourProjectFolder/AdamsLair.WinForms.pdb -YourProjectFolder/AdamsLair.WinForms.xml -YourProjectFolder/perflog_editor.txt -YourProjectFolder/DDoc.chm -YourProjectFolder/DesignTimeData.dat -YourProjectFolder/DualityEditor.pdb -YourProjectFolder/DualityEditor.xml -YourProjectFolder/DualityLauncher.exe -YourProjectFolder/DualityLauncher.exe.config -YourProjectFolder/DualityLauncher.pdb -YourProjectFolder/DualityPrimitives.XML -YourProjectFolder/AdamsLair.WinForms.dll -YourProjectFolder/Source/Code/CorePlugin/bin/ -YourProjectFolder/Source/Code/CorePlugin/obj/ -YourProjectFolder/Source/Code/CorePlugin/GamePlugin.core.xml -YourProjectFolder/Source/Code/EditorPlugin/bin/ -YourProjectFolder/Source/Code/EditorPlugin/obj/ -YourProjectFolder/Source/Code/EditorPlugin/GamePlugin.core.xml -YourProjectFolder/Source/Code/*.suo -YourProjectFolder/Source/Code/.vs -``` +- All files from the main folder that are not part of the Duality download package, as they're auto-installed on first launch after checkout. The only exception are the files `DefaultUserData.dat` and `AppData.dat`, which should not be ignored. \ No newline at end of file From 732d856ca58a4d6b83d68bf9840da5c9bcf1683b Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Fri, 22 May 2020 21:19:53 +0200 Subject: [PATCH 2/8] wip --- pages/v4/Duality-and-Version-Control.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index d919ba8..ea0c264 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -66,7 +66,6 @@ This is not a one-off operation - if you delete all files except for the ones th In the initial commit of your project, you will spend a lot of time adding files to your version control systems ignore list. Let's go through the most important files and folders to ignore, and see _why_ they should be ignored: -- `**/bin` and `**/obj` are the output and intermediate folders for building your game. There is a post-build step that copies the binaries over to the root Duality folder and the `Plugins` folder where they need to be, so we don't need either of those folders. Ignore! -- `Plugins` (the entire content, not the folder) except for the game and editor plugin files that you build yourself from the `Source` folder. Adding them to version control means a few megabytes of extra data, but it can pay off for the added convenience of not having to build the source code after checkout just to start the game or run the editor. +- Build output files (`**/bin`, `**/obj`, `Duality/Plugins`, `Duality/*.dll` etc) are the output files/folders building your game so we don't need these. Ignore! - `Backup` because that's what our version control system already does. - All files from the main folder that are not part of the Duality download package, as they're auto-installed on first launch after checkout. The only exception are the files `DefaultUserData.dat` and `AppData.dat`, which should not be ignored. \ No newline at end of file From 5de29ef6fd5344c3f7c34f26686e02a17a657354 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Fri, 22 May 2020 21:51:10 +0200 Subject: [PATCH 3/8] Updated duality and version control article --- pages/v4/Duality-and-Version-Control.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index ea0c264..0953948 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -60,12 +60,14 @@ If you're an experienced version control user, you know that you sometimes need When you initially downloaded and installed Duality, you may have noticed that there was no dedicated installer software, only a solution file with some projects. Building it for the first time will download all the required packages and copies them into place. After this you can run Duality. -This is not a one-off operation - if you delete all files except for the ones that came with the download, you can simply build Duality again to restore these files. We can use this behavior to keep our version control repository clean of all binaries. +This is not a one-off operation - if you delete all files except for the ones that came with the download, you can simply build your solutions again to restore these files. We can use this behavior to keep our version control repository clean of all binaries. ## The Initial Setup Commit -In the initial commit of your project, you will spend a lot of time adding files to your version control systems ignore list. Let's go through the most important files and folders to ignore, and see _why_ they should be ignored: +The duality project template already comes with a pre-configured .gitignore file for you so you don't have to do this yourself. However it is good to know why some files are ignored and others are not. +Let's go through the most important files and folders to ignore, and see _why_ they should be ignored: - Build output files (`**/bin`, `**/obj`, `Duality/Plugins`, `Duality/*.dll` etc) are the output files/folders building your game so we don't need these. Ignore! -- `Backup` because that's what our version control system already does. -- All files from the main folder that are not part of the Duality download package, as they're auto-installed on first launch after checkout. The only exception are the files `DefaultUserData.dat` and `AppData.dat`, which should not be ignored. \ No newline at end of file +- `Duality/Backup` because that's what our version control system already does. +- `Duality/Temp` these contain only temporary files which are not needed to be under source control. +- `Source/.vs` this folder contains temporary files used by visual studio. \ No newline at end of file From 7b3159c363c927a8210ac6c7be487fd36915de09 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Fri, 22 May 2020 21:53:45 +0200 Subject: [PATCH 4/8] added updated example gitignore file --- pages/v4/Duality-and-Version-Control.md | 27 ++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index 0953948..f9b4665 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -70,4 +70,29 @@ Let's go through the most important files and folders to ignore, and see _why_ t - Build output files (`**/bin`, `**/obj`, `Duality/Plugins`, `Duality/*.dll` etc) are the output files/folders building your game so we don't need these. Ignore! - `Duality/Backup` because that's what our version control system already does. - `Duality/Temp` these contain only temporary files which are not needed to be under source control. -- `Source/.vs` this folder contains temporary files used by visual studio. \ No newline at end of file +- `Source/.vs` this folder contains temporary files used by visual studio. + +### Example Git Ignore File + +If you're using **git**, here is a sample `.gitignore` file from the template for you to start with. + +``` +# Build output files +**/bin +**/obj + +# Duality specific files +Duality/Temp +Duality/Backup +Duality/UserData.dat +Duality/DesignTimeData.dat +Duality/*.pdb +Duality/*.dll +Duality/*.exe +Duality/*.txt +Duality/*.xml +Duality/Plugins + +# Visual studio specific files +Source/.vs +``` \ No newline at end of file From d7a36e39b35fe5fdd9a192d405dfaeabf3f97dad Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Fri, 5 Jun 2020 19:11:57 +0200 Subject: [PATCH 5/8] update gitignore sample --- pages/v4/Duality-and-Version-Control.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index f9b4665..9218d70 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -82,16 +82,16 @@ If you're using **git**, here is a sample `.gitignore` file from the template fo **/obj # Duality specific files -Duality/Temp -Duality/Backup -Duality/UserData.dat -Duality/DesignTimeData.dat -Duality/*.pdb -Duality/*.dll -Duality/*.exe -Duality/*.txt -Duality/*.xml -Duality/Plugins +/Temp +/Backup +/UserData.dat +/DesignTimeData.dat +*.pdb +/*.dll +/*.exe +/*.txt +/*.xml +/Plugins # Visual studio specific files Source/.vs From 8be6f2013123ad2fcc6f08cefcc4f0d4ce94bd60 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Fri, 5 Jun 2020 19:14:10 +0200 Subject: [PATCH 6/8] update --- pages/v4/Duality-and-Version-Control.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index 9218d70..048a512 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -67,9 +67,9 @@ This is not a one-off operation - if you delete all files except for the ones th The duality project template already comes with a pre-configured .gitignore file for you so you don't have to do this yourself. However it is good to know why some files are ignored and others are not. Let's go through the most important files and folders to ignore, and see _why_ they should be ignored: -- Build output files (`**/bin`, `**/obj`, `Duality/Plugins`, `Duality/*.dll` etc) are the output files/folders building your game so we don't need these. Ignore! -- `Duality/Backup` because that's what our version control system already does. -- `Duality/Temp` these contain only temporary files which are not needed to be under source control. +- Build output files (`**/bin`, `**/obj`, `Plugins`, `*.dll` etc) are the output files/folders building your game so we don't need these. Ignore! +- `Backup` because that's what our version control system already does. +- `Temp` these contain only temporary files which are not needed to be under source control. - `Source/.vs` this folder contains temporary files used by visual studio. ### Example Git Ignore File From e83214057b047a0c1c20daf4d00bb32d6fad8140 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Mon, 8 Jun 2020 15:32:14 +0200 Subject: [PATCH 7/8] update gitignore example --- pages/v4/Duality-and-Version-Control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index 048a512..87d9117 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -94,5 +94,5 @@ If you're using **git**, here is a sample `.gitignore` file from the template fo /Plugins # Visual studio specific files -Source/.vs +/.vs ``` \ No newline at end of file From 768429870c3ccebb09f5c61222345e99ed5e8974 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Mon, 8 Jun 2020 15:33:03 +0200 Subject: [PATCH 8/8] update gitignore example --- pages/v4/Duality-and-Version-Control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/v4/Duality-and-Version-Control.md b/pages/v4/Duality-and-Version-Control.md index 87d9117..566f221 100644 --- a/pages/v4/Duality-and-Version-Control.md +++ b/pages/v4/Duality-and-Version-Control.md @@ -70,7 +70,7 @@ Let's go through the most important files and folders to ignore, and see _why_ t - Build output files (`**/bin`, `**/obj`, `Plugins`, `*.dll` etc) are the output files/folders building your game so we don't need these. Ignore! - `Backup` because that's what our version control system already does. - `Temp` these contain only temporary files which are not needed to be under source control. -- `Source/.vs` this folder contains temporary files used by visual studio. +- `/.vs` this folder contains temporary files used by visual studio. ### Example Git Ignore File