Source control: Difference between revisions

From VNDev Wiki
No edit summary
m nav
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Source control is a set of activities which is often performed by any member of the team who is producing game assets of any kind (script, art, music, code, etc). It involves managing and organizing different versions of the assets produced, communicating to the [[Visual_Novel_Development_Team|team]] about changes made and the version to use for relevant team members. With VNs that have longer development duration, a [https://betterexplained.com/articles/a-visual-guide-to-version-control/ version control system] can be used to assist the development team in managing asset changes as well as facilitate coding in parallel. The job of managing the version control system typically falls under the [[Visual_Novel_Development_Team#Programmer|programmer]]'s role.
{{cleanup}}
{{expand article}}
{{Split to guide|to= choosing a source control system and/or how to use git.}}
Source control is a set of activities which is often performed by any member of the team who is producing game assets of any kind (script, art, music, code, etc). It involves managing and organizing different versions of the assets produced, communicating to the [[development team|team]] about changes made and the version to use for relevant team members. With VNs that have longer development duration, a [https://www.geeksforgeeks.org/version-control-systems/ version control system] can be used to assist the development team in managing asset changes as well as facilitate coding in parallel. The job of managing the version control system typically falls under the [[Development team#Programmer|programmer]]'s role.


== Source control tools ==
== Classic source control ==
 
=== Classic ===
* [https://drive.google.com/ Google Drive]
* [https://drive.google.com/ Google Drive]
* [https://www.dropbox.com/ Dropbox]
* [https://www.dropbox.com/ Dropbox]
* [https://discord.com/Discord]
* [https://discord.com/ Discord]
* any application that allows file sharing
* any application that allows file sharing


=== Version control system ===
== Version control system ==
* Github
 
=== Tools ===
* [https://git-scm.com/downloads Git]
* [https://www.mercurial-scm.org/ Mercurial]
 
[https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control Version control systems] such as Git is often used along with a repository management service such as [https://github.com/ GitHub] or [https://bitbucket.org/product Bitbucket]. These services allow you to make coding assets and game builds available for all team members (or the public if desired), with additional functionalities unique to version control system such as [https://yangsu.github.io/pull-request-tutorial/ pull requests] which supports coding in parallel. Similar to file sharing websites, these hosting services can serve as backup of game assets and protection against irreversible changes, as all committed changes are recorded and any earlier version of the game assets can be recovered.
 
=== Terminology ===
* Repository: folder containing the game assets that the version control system will track
* Clone: make a copy of a repository hosted on a website (e.g. GitHub) and download it
* Commit: record a set of changes made to the tracked files in the repository
* Commit History: list of all commits/changes made to the repository
* Branch: group of commits on top of a base commit history
* Merge: combine two branches/commit history to form one commit history
* Merge Conflicts: conflicting changes detected when attempting to merge
* Pull: merge the remote/hosted branch into the local branch (website to local)
* Push: merge the local branch into the remote/hosted branch (local to website)
 
=== Quick start ===
Quick guide for setting up with GitHub because it's free and widely used:
 
==== Do it once ====
You can use GitHub either with the Command Line Interface (CLI) or GitHub Desktop. Installing GitHub Desktop also installs Git for the CLI. Another option is to use the integrated Git extension inside [https://code.visualstudio.com/docs/sourcecontrol/intro-to-git Visual Studio Code] (Assuming it's already your IDE/Coding software of choice).
 
===== Git CLI =====
# Create a GitHub account [https://github.com/signup here]
# Install Git [https://git-scm.com/downloads here]
# Set your GitHub username and email on the CLI (refer [https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git#setting-your-git-username-for-every-repository-on-your-computer here] and [https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address#setting-your-commit-email-address-in-git here])
# Create a personal access token, set it to never expire and save it somewhere ([https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token steps here])
 
===== GitHub desktop =====
# Create a GitHub account [https://github.com/signup here]
# Install GitHub Desktop [https://desktop.github.com/ here]
# Authenticate your GitHub account (check [https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/installing-and-authenticating-to-github-desktop/authenticating-to-github here])
 
==== New game setup ====
With every new game.
 
===== Git CLI =====
# Create a new repository on GitHub ([https://docs.github.com/en/get-started/quickstart/hello-world#creating-a-repository steps here])
# Google for the gitignore file of your game engine (here's [https://raw.githubusercontent.com/renpy/renpy/master/.gitignore renpy])
# Add the .gitignore file in the repository and commit on GitHub (refer [https://docs.github.com/en/get-started/quickstart/create-a-repo#commit-your-first-change here])
# Clone the repository to your computer ([https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository#cloning-a-repository steps here])
#<li value="5"> Add your game files to the repository and commit in CLI
git commit -m "add game files !"
#<li value="6"> To update the repository on GitHub, push in CLI (enter your token when asked for password)
git push
#<li value="7"> Happy jamming!
 
===== GitHub Desktop =====
# Create a new repository on GitHub ([https://docs.github.com/en/get-started/quickstart/hello-world#creating-a-repository steps here])
# Google for the gitignore file of your game engine (here's [https://raw.githubusercontent.com/renpy/renpy/master/.gitignore renpy])
# Add the .gitignore file in the repository and commit on GitHub (refer [https://docs.github.com/en/get-started/quickstart/create-a-repo#commit-your-first-change here])
# Clone the repository to your computer (refer [https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/cloning-a-repository-from-github-to-github-desktop here])
# Add your game files to the repository and commit in GitHub Desktop (check [https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/overview/creating-your-first-repository-using-github-desktop#part-5-making-committing-and-pushing-changes here])
# To update the repository on GitHub, push origin in GitHub Desktop (refer [https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/making-changes-in-a-branch/pushing-changes-to-github#pushing-changes-to-github here])
# Happy jamming!
 
For more references on getting started with GitHub, here's the official [https://docs.github.com/en/get-started/quickstart/hello-world docs].
 
{{development nav}}
[[Category:Programming]]
[[Category:Production]]

Latest revision as of 10:42, 1 November 2024

Source control is a set of activities which is often performed by any member of the team who is producing game assets of any kind (script, art, music, code, etc). It involves managing and organizing different versions of the assets produced, communicating to the team about changes made and the version to use for relevant team members. With VNs that have longer development duration, a version control system can be used to assist the development team in managing asset changes as well as facilitate coding in parallel. The job of managing the version control system typically falls under the programmer's role.

Classic source control

Version control system

Tools

Version control systems such as Git is often used along with a repository management service such as GitHub or Bitbucket. These services allow you to make coding assets and game builds available for all team members (or the public if desired), with additional functionalities unique to version control system such as pull requests which supports coding in parallel. Similar to file sharing websites, these hosting services can serve as backup of game assets and protection against irreversible changes, as all committed changes are recorded and any earlier version of the game assets can be recovered.

Terminology

  • Repository: folder containing the game assets that the version control system will track
  • Clone: make a copy of a repository hosted on a website (e.g. GitHub) and download it
  • Commit: record a set of changes made to the tracked files in the repository
  • Commit History: list of all commits/changes made to the repository
  • Branch: group of commits on top of a base commit history
  • Merge: combine two branches/commit history to form one commit history
  • Merge Conflicts: conflicting changes detected when attempting to merge
  • Pull: merge the remote/hosted branch into the local branch (website to local)
  • Push: merge the local branch into the remote/hosted branch (local to website)

Quick start

Quick guide for setting up with GitHub because it's free and widely used:

Do it once

You can use GitHub either with the Command Line Interface (CLI) or GitHub Desktop. Installing GitHub Desktop also installs Git for the CLI. Another option is to use the integrated Git extension inside Visual Studio Code (Assuming it's already your IDE/Coding software of choice).

Git CLI
  1. Create a GitHub account here
  2. Install Git here
  3. Set your GitHub username and email on the CLI (refer here and here)
  4. Create a personal access token, set it to never expire and save it somewhere (steps here)
GitHub desktop
  1. Create a GitHub account here
  2. Install GitHub Desktop here
  3. Authenticate your GitHub account (check here)

New game setup

With every new game.

Git CLI
  1. Create a new repository on GitHub (steps here)
  2. Google for the gitignore file of your game engine (here's renpy)
  3. Add the .gitignore file in the repository and commit on GitHub (refer here)
  4. Clone the repository to your computer (steps here)
  5. Add your game files to the repository and commit in CLI
git commit -m "add game files !"
  1. To update the repository on GitHub, push in CLI (enter your token when asked for password)
git push
  1. Happy jamming!
GitHub Desktop
  1. Create a new repository on GitHub (steps here)
  2. Google for the gitignore file of your game engine (here's renpy)
  3. Add the .gitignore file in the repository and commit on GitHub (refer here)
  4. Clone the repository to your computer (refer here)
  5. Add your game files to the repository and commit in GitHub Desktop (check here)
  6. To update the repository on GitHub, push origin in GitHub Desktop (refer here)
  7. Happy jamming!

For more references on getting started with GitHub, here's the official docs.