{"id":1873,"date":"2023-05-11T22:07:38","date_gmt":"2023-05-11T22:07:38","guid":{"rendered":"https:\/\/writingagame.com\/?p=1873"},"modified":"2025-04-03T19:21:53","modified_gmt":"2025-04-03T19:21:53","slug":"github","status":"publish","type":"post","link":"https:\/\/writingagame.com\/index.php\/2023\/05\/11\/github\/","title":{"rendered":"GitHub"},"content":{"rendered":"\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. Open provided GitHub repository link, for example (like in chapter 3) <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/bkantemir\/_wg_403\" target=\"_blank\">https:\/\/github.com\/bkantemir\/_wg_403<\/a><\/p>\n\n\n\n<p>2. Click green button &#8220;Code&#8221;.<\/p>\n\n\n\n<p>3. I usually use &#8220;Download ZIP&#8221;.<\/p>\n\n\n\n<p>4. When downloaded, go to your <em>Downloads <\/em>folder and unpack downloaded <em>zip<\/em> file to your hard drive (usually C:).<\/p>\n\n\n\n<p>5. Since in my case all project&#8217;s paths are relative, it is safe to rename created project folder at your discretion (like &#8220;CPP&#8221; for example). <\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Then follow <em>README.md<\/em> instructions. Like particularly in this example, how to open projects:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"windows-solution\">Windows project<\/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 (in this particular sample) <em><em>_wg_403\\a999hello\\pw\\pw.sln<\/em><\/em><\/p>\n\n\n\n<p>9. <strong>IMPORTANT<\/strong>: Make sure that configuration (in the top VS menu) is set to <strong>x64<\/strong>.<\/p>\n\n\n\n<p>10. Rebuild and run the project (green arrow). Make sure it works.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"windows-solution\">Android project<\/h2>\n\n\n\n<p>11. Start Android Studio, <\/p>\n\n\n\n<p>12. Close current project (if any)<\/p>\n\n\n\n<p>13. Proceed to &#8220;Open&#8221;.<\/p>\n\n\n\n<p>14. Open <em><em>_wg_403-main\\a999hello\\pa<\/em><\/em><\/p>\n\n\n\n<p>15. Switch on your Android, <strong>unlock<\/strong>, plug in to the comp, allow debugging. Wait for it to appear in Studio&#8217;s top menu.<\/p>\n\n\n\n<p>16. Rebuild and run the project (green arrow). Make sure it works.<\/p>\n\n\n\n<p>That&#8217;s it. <\/p>\n\n\n\n<p><\/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 to 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\">\n<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>\n<\/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# _wg_403\n&lt;a href=&quot;https:\/\/writingagame.com\/&quot;&gt;WritingAGame.com&lt;\/a&gt; Chapters 2 and 3\n&lt;br \/&gt;\n&lt;b&gt;GameDev, 3D, cross-platform, C++, Android, Windows, OpenGL ES 3.2, Visual Studio, Android Studio&lt;\/b&gt;\n&lt;br \/&gt;\nWindows solution, &lt;b&gt;x64&lt;\/b&gt;, Visual Studio: &lt;br \/&gt;\n&lt;i&gt;_wg_403\\a999hello\\pw\\pw.sln&lt;\/i&gt;\n&lt;br \/&gt;\nAndroid solution, &lt;b&gt;ARM64&lt;\/b&gt;, Android Studio: &lt;br \/&gt;\n&lt;i&gt;_wg_403\\a999hello\\pa&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 combo of GitHub&#8217;s templates for Visual Studio and for Android:<\/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# User-specific files\n*.rsuser\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n# User-specific files (MonoDevelop\/Xamarin Studio)\n*.userprefs\n# Mono auto generated files\nmono_crash.*\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# 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# Visual Studio 2017 auto generated files\nGenerated\\ Files\/\n# MSTest test Results\n&#91;Tt]est&#91;Rr]esult*\/\n&#91;Bb]uild&#91;Ll]og.*\n# NUnit\n*.VisualState.xml\nTestResult.xml\nnunit-*.xml\n# Build Results of an ATL Project\n&#91;Dd]ebugPS\/\n&#91;Rr]eleasePS\/\ndlldata.c\n# Benchmark Results\nBenchmarkDotNet.Artifacts\/\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts\/\n# ASP.NET Scaffolding\nScaffoldingReadMe.txt\n# StyleCop\nStyleCopReport.xml\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# Chutzpah Test files\n_Chutzpah*\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# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n# Visual Studio Trace Files\n*.e2e\n# TFS 2012 Local Workspace\n$tf\/\n# Guidance Automation Toolkit\n*.gpState\n# ReSharper is a .NET coding add-in\n_ReSharper*\/\n*.&#91;Rr]e&#91;Ss]harper\n*.DotSettings.user\n# TeamCity is a build add-in\n_TeamCity*\n# DotCover is a Code Coverage Tool\n*.dotCover\n# AxoCover is a Code Coverage Tool\n.axoCover\/*\n!.axoCover\/settings.json\n# Coverlet is a free, cross platform Code Coverage Tool\ncoverage*.json\ncoverage*.xml\ncoverage*.info\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n# MightyMoose\n*.mm.*\nAutoTest.Net\/\n# Web workbench (sass)\n.sass-cache\/\n# Installshield output folder\n&#91;Ee]xpress\/\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# Click-Once directory\npublish\/\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# 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# 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# Microsoft Azure Build Output\ncsx\/\n*.build.csdef\n# Microsoft Azure Emulator\necf\/\nrcf\/\n# Windows Store app package directories and files\nAppPackages\/\nBundleArtifacts\/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n*.appx\n*.appxbundle\n*.appxupload\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# Others\nClientBin\/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n# Including strong name files can present a security risk\n# (https:\/\/github.com\/github\/gitignore\/pull\/2483#issue-259490424)\n#*.snk\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# RIA\/Silverlight projects\nGenerated_Code\/\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# SQL Server files\n*.mdf\n*.ldf\n*.ndf\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# Microsoft Fakes\nFakesAssemblies\/\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules\/\n# Visual Studio 6 build log\n*.plg\n# Visual Studio 6 workspace options file\n*.opt\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n# Visual Studio 6 auto-generated project file (contains which files were open etc.)\n*.vbp\n# Visual Studio 6 workspace and project file (working project files containing files to include in project)\n*.dsw\n*.dsp\n# Visual Studio 6 technical files \n*.ncb\n*.aps\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# Paket dependency manager\n.paket\/paket.exe\npaket-files\/\n# FAKE - F# Make\n.fake\/\n# CodeRush personal settings\n.cr\/personal\n# Python Tools for Visual Studio (PTVS)\n__pycache__\/\n*.pyc\n# Cake - Uncomment if you are using it\n# tools\/**\n# !tools\/packages.config\n# Tabs Studio\n*.tss\n# Telerik&#039;s JustMock configuration file\n*.jmconfig\n# BizTalk build output\n*.btp.cs\n*.btm.cs\n*.odx.cs\n*.xsd.cs\n# OpenCover UI analysis results\nOpenCover\/\n# Azure Stream Analytics local run output\nASALocalRun\/\n# MSBuild Binary and Structured Log\n*.binlog\n# NVidia Nsight GPU debugger configuration file\n*.nvuser\n# MFractors (Xamarin productivity tool) working folder\n.mfractor\/\n# Local History for Visual Studio\n.localhistory\/\n# Visual Studio History (VSHistory) files\n.vshistory\/\n# BeatPulse healthcheck temp database\nhealthchecksdb\n# Backup folder for Package Reference Convert tool in Visual Studio 2017\nMigrationBackup\/\n# Ionide (cross platform F# VS Code tools) working folder\n.ionide\/\n# Fody - auto-generated XML schema\nFodyWeavers.xsd\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# Local History for Visual Studio Code\n.history\/\n# Windows Installer files from build outputs\n*.cab\n*.msi\n*.msix\n*.msm\n*.msp\n# JetBrains Rider\n*.sln.iml\n# Android\n# Built application files\n*.apk\n*.aar\n*.ap_\n*.aab\n# Files for the ART\/Dalvik VM\n*.dex\n# Java class files\n*.class\n# Generated files\nbin\/\ngen\/\nout\/\n#  Uncomment the following line in case you need and you don&#039;t have the release build type files in your app\n# release\/\n# Gradle files\n.gradle\/\nbuild\/\n# Local configuration file (sdk path, etc)\nlocal.properties\n# Proguard folder generated by Eclipse\nproguard\/\n# Log Files\n*.log\n# Android Studio Navigation editor temp files\n.navigation\/\n# Android Studio captures folder\ncaptures\/\n# IntelliJ\n*.iml\n.idea\/\n# .idea\/workspace.xml\n# .idea\/tasks.xml\n# .idea\/gradle.xml\n# .idea\/assetWizardSettings.xml\n# .idea\/dictionaries\n.idea\/libraries\n# Android Studio 3 in .gitignore file.\n.idea\/caches\n.idea\/modules.xml\n# Comment next line if keeping position of elements in Navigation Editor is relevant for you\n.idea\/navEditor.xml\n# Keystore files\n# Uncomment the following lines if you do not want to check your keystore files in.\n*.jks\n*.keystore\n# External native build folder generated in Android Studio 2.2 and later\n.externalNativeBuild\n.cxx\/\n# Google Services (e.g. APIs or Firebase)\ngoogle-services.json\n# Freeline\nfreeline.py\nfreeline\/\nfreeline_project_description.json\n# fastlane\nfastlane\/report.xml\nfastlane\/Preview.html\nfastlane\/screenshots\nfastlane\/test_output\nfastlane\/readme.md\n# Version control\nvcs.xml\n# lint\nlint\/intermediates\/\nlint\/generated\/\nlint\/outputs\/\nlint\/tmp\/\n# lint\/reports\/\n# MacOS\n.DS_Store\n# App Specific cases \napp\/release\/output.json\n.idea\/codeStyles\/\n\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Both files are stored in root C:\/CPP directory.<\/li>\n<\/ul>\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\">\n<li>Don&#8217;t miss a dot at the end.<\/li>\n<\/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\">\n<li>This is ONE single string<\/li>\n\n\n\n<li>Don&#8217;t forget to replace &#8220;<em>YOUR_git_account\/YOUR_repository_name<\/em>&#8221; by your <strong>actual <\/strong>names<\/li>\n<\/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-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p class=\"mb-2\">How to download repository from GitHub 1. Open provided GitHub repository link, for example (like in chapter 3) https:\/\/github.com\/bkantemir\/_wg_403 2. Click green button &#8220;Code&#8221;. 3. I usually use &#8220;Download ZIP&#8221;. 4. When downloaded, go to your Downloads folder and unpack downloaded zip file to your hard drive (usually C:). 5. Since in my case all [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1873","post","type-post","status-publish","format-standard","hentry","category-side-notes"],"_links":{"self":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1873","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=1873"}],"version-history":[{"count":9,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1873\/revisions"}],"predecessor-version":[{"id":3319,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1873\/revisions\/3319"}],"wp:attachment":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/media?parent=1873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/categories?post=1873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/tags?post=1873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}