{"id":1355,"date":"2022-01-30T05:53:02","date_gmt":"2022-01-30T05:53:02","guid":{"rendered":"https:\/\/writingagame.com\/?p=1355"},"modified":"2022-07-06T19:05:17","modified_gmt":"2022-07-06T19:05:17","slug":"chapter-37-github","status":"publish","type":"post","link":"https:\/\/writingagame.com\/index.php\/2022\/01\/30\/chapter-37-github\/","title":{"rendered":"Chapter 37.2. GitHub"},"content":{"rendered":"\n<p>Just to make sure that we are on the same page, let&#8217;s synchronize our environments.<\/p>\n\n\n\n<p>You can download full current Project repository from<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/bkantemir\/_wg37\">https:\/\/github.com\/bkantemir\/_wg37<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Windows solution, <strong>x86:<\/strong> <em>_wg37-main\\a997modeler\\p_windows\\p_windows.sln<\/em><\/li><li>Android solution, <strong>ARM64:<\/strong> <em>_wg37<em>-main<\/em>\\a997modeler\\p_android\\p_android.sln<\/em><\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Important changes here:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In order to untie the project from <em>C:\\CPP<\/em>, all paths in projects properties were  converted to relative form. Like <em>..\\..\\engine<\/em> instead of <em>C:\\CPP\\engine<\/em>.<\/li><li>To make repository lighter I deleted unnecessary libraries from GLFW folder.<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-download-repository-from-github\">How to download repository from GitHub<\/h2>\n\n\n\n<p>1. Go to <a href=\"https:\/\/github.com\/bkantemir\/_wg37\">https:\/\/github.com\/bkantemir\/_wg37<\/a><\/p>\n\n\n\n<p>2. Click green button &#8220;Code&#8221;.<\/p>\n\n\n\n<p>3. I usually pick &#8220;Download ZIP&#8221;.<\/p>\n\n\n\n<p>4. When downloaded, go to your <em>Downloads <\/em>folder and unpack <em>_wg37-main.zip<\/em> file to your hard drive (usually C:).<\/p>\n\n\n\n<p>5. Since all project&#8217;s paths are relative, it is safe to rename created <em>_wg37-main<\/em> folder up to your taste (like &#8220;CPP&#8221; in my case). <\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"windows-solution\">Windows solution<\/h2>\n\n\n\n<p>6. Start Visual Studio, <\/p>\n\n\n\n<p>7. Proceed to &#8220;Open a project or solution&#8221;.<\/p>\n\n\n\n<p>8. Open <em>_wg37-main\\<strong>a997modeler<\/strong>\\p_windows\\p_windows.sln<\/em><\/p>\n\n\n\n<p>9. <strong>IMPORTANT<\/strong>: Make sure that configuration (in the top VS menu) is set to <strong>x86<\/strong>.<\/p>\n\n\n\n<p>10. Rebuild and run the project (green arrow). Make sure it works.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"windows-solution\">Android solution<\/h2>\n\n\n\n<p>11. Restart Visual Studio, <\/p>\n\n\n\n<p>12. Proceed to &#8220;Open a project or solution&#8221;.<\/p>\n\n\n\n<p>13. Open <em><em>_wg37<em>-main<\/em>\\<strong>a997modeler<\/strong>\\p_android\\p_android.sln<\/em><\/em><\/p>\n\n\n\n<p>14. <strong>IMPORTANT<\/strong>: Make sure that configuration (in the top VS menu) is set to <strong>ARM64<\/strong>.<\/p>\n\n\n\n<p>15. Switch on your Android, <strong>unlock<\/strong>, plug in to the comp, allow debugging.<\/p>\n\n\n\n<p>16. Rebuild and run the project (green arrow). Make sure it works.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>That&#8217;s it. <\/p>\n\n\n\n<iframe loading=\"lazy\" width=\"100%\" height=\"400\" src=\"https:\/\/www.youtube.com\/embed\/6xY-nfuW2Do?controls=0&amp;autoplay=1&amp;loop=1&amp;playlist=6xY-nfuW2Do\" title=\"Glass effect\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\n\n\n\n<p><\/p>\n\n\n\n<p>Now our environments are not just compatible, but <strong>identical<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Just in case you ever need:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-upload-your-project-on-github\">How to UPLOAD your project on GitHub<\/h2>\n\n\n\n<p>Let&#8217;s say (as in my case) you have a folder\/project on your computer that you want to publish on GitHub.<\/p>\n\n\n\n<p>First, you will need a GitHub account. Go to <a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/<\/a> and sign up.<\/p>\n\n\n\n<p>Second, you will need a repository. Click on &#8220;+&#8221; in the upper right corner and add <em>New repository<\/em>.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To keep repository completely empty at this point, <strong>don&#8217;t<\/strong> pick <em>readmi <\/em>or <em>gitignore <\/em>options. I created them <strong>locally <\/strong>and then uploaded to GitHub along with everything else.<\/li><\/ul>\n\n\n\n<p>Just in case, my <em>README.md<\/em> file looks like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n# _wg37\n&lt;a href=&quot;https:\/\/writingagame.com\/&quot;&gt;WritingAGame.com&lt;\/a&gt; Chapter 37\n&lt;br \/&gt;\n&lt;b&gt;GameDev, 3D, cross-platform, C++, Visual Studio 2022, Android, Windows, OpenGL ES 3.2&lt;\/b&gt;\n&lt;br \/&gt;\n&lt;a href=&quot;https:\/\/www.youtube.com\/watch?v=R8ZICjQ5ABQ&quot;&gt;Demo&lt;\/a&gt;\n&lt;br \/&gt;\nWindows solution, &lt;b&gt;x86&lt;\/b&gt;: &lt;br \/&gt;\n&lt;i&gt;_wg37\\a997modeler\\p_windows\\p_windows.sln&lt;\/i&gt;\n&lt;br \/&gt;\nAndroid solution, &lt;b&gt;ARM64&lt;\/b&gt;: &lt;br \/&gt;\n&lt;i&gt;_wg37\\a997modeler\\p_android\\p_android.sln&lt;\/i&gt;\n&lt;br \/&gt;\n\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>My <em>.gitignore<\/em> file is just a copy of GitHub&#8217;s template for Visual Studio:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## Get latest from https:\/\/github.com\/github\/gitignore\/blob\/main\/VisualStudio.gitignore\n\n# User-specific files\n*.rsuser\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop\/Xamarin Studio)\n*.userprefs\n\n# Mono auto generated files\nmono_crash.*\n\n# Build results\n&#91;Dd]ebug\/\n&#91;Dd]ebugPublic\/\n&#91;Rr]elease\/\n&#91;Rr]eleases\/\nx64\/\nx86\/\n&#91;Ww]&#91;Ii]&#91;Nn]32\/\n&#91;Aa]&#91;Rr]&#91;Mm]\/\n&#91;Aa]&#91;Rr]&#91;Mm]64\/\nbld\/\n&#91;Bb]in\/\n&#91;Oo]bj\/\n&#91;Ll]og\/\n&#91;Ll]ogs\/\n\n# Visual Studio 2015\/2017 cache\/options directory\n.vs\/\n# Uncomment if you have tasks that create the project&#039;s static files in wwwroot\n#wwwroot\/\n\n# Visual Studio 2017 auto generated files\nGenerated\\ Files\/\n\n# MSTest test Results\n&#91;Tt]est&#91;Rr]esult*\/\n&#91;Bb]uild&#91;Ll]og.*\n\n# NUnit\n*.VisualState.xml\nTestResult.xml\nnunit-*.xml\n\n# Build Results of an ATL Project\n&#91;Dd]ebugPS\/\n&#91;Rr]eleasePS\/\ndlldata.c\n\n# Benchmark Results\nBenchmarkDotNet.Artifacts\/\n\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts\/\n\n# ASP.NET Scaffolding\nScaffoldingReadMe.txt\n\n# StyleCop\nStyleCopReport.xml\n\n# Files built by Visual Studio\n*_i.c\n*_p.c\n*_h.h\n*.ilk\n*.meta\n*.obj\n*.iobj\n*.pch\n*.pdb\n*.ipdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*_wpftmp.csproj\n*.log\n*.tlog\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch\/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# Visual Studio Trace Files\n*.e2e\n\n# TFS 2012 Local Workspace\n$tf\/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*\/\n*.&#91;Rr]e&#91;Ss]harper\n*.DotSettings.user\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# AxoCover is a Code Coverage Tool\n.axoCover\/*\n!.axoCover\/settings.json\n\n# Coverlet is a free, cross platform Code Coverage Tool\ncoverage*.json\ncoverage*.xml\ncoverage*.info\n\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net\/\n\n# Web workbench (sass)\n.sass-cache\/\n\n# Installshield output folder\n&#91;Ee]xpress\/\n\n# DocProject is a documentation generator add-in\nDocProject\/buildhelp\/\nDocProject\/Help\/*.HxT\nDocProject\/Help\/*.HxC\nDocProject\/Help\/*.hhc\nDocProject\/Help\/*.hhk\nDocProject\/Help\/*.hhp\nDocProject\/Help\/Html2\nDocProject\/Help\/html\n\n# Click-Once directory\npublish\/\n\n# Publish Web Output\n*.&#91;Pp]ublish.xml\n*.azurePubxml\n# Note: Comment the next line if you want to checkin your web deploy settings,\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts\/\n\n# NuGet Packages\n*.nupkg\n# NuGet Symbol Packages\n*.snupkg\n# The packages folder can be ignored because of Package Restore\n**\/&#91;Pp]ackages\/*\n# except build\/, which is used as an MSBuild target.\n!**\/&#91;Pp]ackages\/build\/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**\/&#91;Pp]ackages\/repositories.config\n# NuGet v3&#039;s project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx\/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf\/\nrcf\/\n\n# Windows Store app package directories and files\nAppPackages\/\nBundleArtifacts\/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n*.appx\n*.appxbundle\n*.appxupload\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.&#91;Cc]ache\n# but keep track of directories ending in .cache\n!?*.&#91;Cc]ache\/\n\n# Others\nClientBin\/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n\n# Including strong name files can present a security risk\n# (https:\/\/github.com\/github\/gitignore\/pull\/2483#issue-259490424)\n#*.snk\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https:\/\/github.com\/github\/gitignore\/pull\/1529#issuecomment-104372622)\n#bower_components\/\n\n# RIA\/Silverlight projects\nGenerated_Code\/\n\n# Backup &amp; report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files\/\nBackup*\/\nUpgradeLog*.XML\nUpgradeLog*.htm\nServiceFabricBackup\/\n*.rptproj.bak\n\n# SQL Server files\n*.mdf\n*.ldf\n*.ndf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n*.rptproj.rsuser\n*- &#91;Bb]ackup.rdl\n*- &#91;Bb]ackup (&#91;0-9]).rdl\n*- &#91;Bb]ackup (&#91;0-9]&#91;0-9]).rdl\n\n# Microsoft Fakes\nFakesAssemblies\/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules\/\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n\n# Visual Studio 6 auto-generated project file (contains which files were open etc.)\n*.vbp\n\n# Visual Studio 6 workspace and project file (working project files containing files to include in project)\n*.dsw\n*.dsp\n\n# Visual Studio 6 technical files \n*.ncb\n*.aps\n\n# Visual Studio LightSwitch build output\n**\/*.HTMLClient\/GeneratedArtifacts\n**\/*.DesktopClient\/GeneratedArtifacts\n**\/*.DesktopClient\/ModelManifest.xml\n**\/*.Server\/GeneratedArtifacts\n**\/*.Server\/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket\/paket.exe\npaket-files\/\n\n# FAKE - F# Make\n.fake\/\n\n# CodeRush personal settings\n.cr\/personal\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__\/\n*.pyc\n\n# Cake - Uncomment if you are using it\n# tools\/**\n# !tools\/packages.config\n\n# Tabs Studio\n*.tss\n\n# Telerik&#039;s JustMock configuration file\n*.jmconfig\n\n# BizTalk build output\n*.btp.cs\n*.btm.cs\n*.odx.cs\n*.xsd.cs\n\n# OpenCover UI analysis results\nOpenCover\/\n\n# Azure Stream Analytics local run output\nASALocalRun\/\n\n# MSBuild Binary and Structured Log\n*.binlog\n\n# NVidia Nsight GPU debugger configuration file\n*.nvuser\n\n# MFractors (Xamarin productivity tool) working folder\n.mfractor\/\n\n# Local History for Visual Studio\n.localhistory\/\n\n# Visual Studio History (VSHistory) files\n.vshistory\/\n\n# BeatPulse healthcheck temp database\nhealthchecksdb\n\n# Backup folder for Package Reference Convert tool in Visual Studio 2017\nMigrationBackup\/\n\n# Ionide (cross platform F# VS Code tools) working folder\n.ionide\/\n\n# Fody - auto-generated XML schema\nFodyWeavers.xsd\n\n# VS Code files for those working on multiple tools\n.vscode\/*\n!.vscode\/settings.json\n!.vscode\/tasks.json\n!.vscode\/launch.json\n!.vscode\/extensions.json\n*.code-workspace\n\n# Local History for Visual Studio Code\n.history\/\n\n# Windows Installer files from build outputs\n*.cab\n*.msi\n*.msix\n*.msm\n*.msp\n\n# JetBrains Rider\n*.sln.iml\n\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Third, you will need <strong>git<\/strong> itself on your computer.<\/p>\n\n\n\n<p>Go to <a rel=\"noreferrer noopener\" href=\"https:\/\/git-scm.com\/\" target=\"_blank\">https:\/\/git-scm.com\/<\/a> -&gt; Downloads -&gt; Windows, and so on.<\/p>\n\n\n\n<p>When installed, go to <strong>Windows File Explorer<\/strong>, right-click on your folder (which you want to share on Git) and pick <em>Git Bash Here<\/em>.<br>It will open a black prompt window.<br>You are already inside of your folder. Type<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git init<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>It will create <em>.git<\/em> sub-folder.<\/p>\n\n\n\n<p>Default branch is called <em>master<\/em>, when GitHub&#8217;s default branch is called <em>main<\/em>.<\/p>\n\n\n\n<p>In order to avoid merging branches in the future, I created <em>main <\/em>branch locally, taking the history from <em>master<\/em>. Command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -m master main<\/code><\/pre>\n\n\n\n<p>Next command will add your folder&#8217;s content to your local git (skipping whatever mentioned in <em>.gitignore<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Don&#8217;t miss a dot at the end.<\/li><\/ul>\n\n\n\n<p>Then we need to make the first <em>commit<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"initial commit\"<\/code><\/pre>\n\n\n\n<p>Now we need to bind our remote GitHub repository to our local folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git remote add origin https:\/\/github.com\/your_git_account\/your_repository_name<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>This is ONE single string<\/li><li>Don&#8217;t forget to replace &#8220;<em>your_git_account\/your_repository_name<\/em>&#8221; by your <strong>actual <\/strong>names<\/li><\/ul>\n\n\n\n<p>And to push local folder to remote GitHub repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push -u origin main<\/code><\/pre>\n\n\n\n<p>That&#8217;s it! It&#8217;s online now.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"mb-2\">Just to make sure that we are on the same page, let&#8217;s synchronize our environments. You can download full current Project repository from https:\/\/github.com\/bkantemir\/_wg37 Windows solution, x86: _wg37-main\\a997modeler\\p_windows\\p_windows.sln Android solution, ARM64: _wg37-main\\a997modeler\\p_android\\p_android.sln Important changes here: In order to untie the project from C:\\CPP, all paths in projects properties were converted to relative form. Like ..\\..\\engine [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1355","post","type-post","status-publish","format-standard","hentry","category-cross-platform-3d"],"_links":{"self":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/comments?post=1355"}],"version-history":[{"count":31,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"predecessor-version":[{"id":1588,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1355\/revisions\/1588"}],"wp:attachment":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/tags?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}