Unity project for the Introduction to Game Development Tools course at the University of Turku
Usefull links and most used git
commands can be read for example from here git-good
Run highlighted git commands on terminal/command line
Clone the repository: git clone git@github.com:niemisami/SitzSimulator.git
Open the SitzSimulator
folder on Unity
To make sure the project stays manageble use
branches
when developing new features etc. Let's try to keep themaster
branch always "clean" and working so anyone who clones the repository from GitHub always get's working code.
- Checkout
master
branch - Fetch latest changes (if any):
git pull
- Check the branch you're on with:
git branch
- If branch is what you want move to the next step
- If the terminal says
* master
, then create a new branch:git checkout -b name-of-the-new-branch
(e.g.git checkout -b 'wobbling-controls
) This command will create a new branch and move into that.
- Start developing
- Check changed files:
git status
- Add all or select files to be committed: all files
git add .
or single file with it's namegit add file.txt
- Check that correct files are added:
git status
- Make a meaningful commit message:
git commit -m "Improve avatar movement
- Checkout master branch:
git checkout master
- Fetch latest changes (if any):
git pull
- Checkout feature branch:
git checkout name-of-the-new-branch
- Merge master to feature:
git merge master
- Check that everything works and/or fix merge conflicts and follow instructions on terminal
- When everything is ok move to master:
git checkout master
- Merge new features to master:
git merge name-of-the-new-branch
- Push master to GitHub:
git push origin master
Same branches can be used again and again but after merge with master branches could be removed if one wants with git branch -d name-of-the-new-branch
and then create a new branch following the instructions in "Beginning a new feature"
If using Visual Studio Code as a main code editor note that some Unity generated files and folders are hidden on the editor e.g. ProjectSettings
. These files are neither auto generated or managed by Unity therefore not neccessary to display on the editor.
Many files are also ignored from version control due the same reason. See .gitignore
file.