1

I am trying to integrate a version/source control system with my unity project. This answer directed me towards using source/version control. (I dont know the difference.)

The answer links to a tutorial which explains creating the repository and pushing it to a remote service. I followed the whole tutorial. But I still don't understand how this integrates with my current projects.

My question is that.

  1. how can I do this locally
  2. how will this make it possible to revert to previously-saved versions?
Robin Daugherty
  • 7,115
  • 4
  • 45
  • 59
Mark S
  • 347
  • 1
  • 4
  • 12

2 Answers2

0

First you install Git (or SVN, Sourcetree,...).

Navigate to the project using cd.

  1. git init (initiate a git repo, it adds a .git folder)
  2. Do changes to your project
  3. git status (shows if any differences)
  4. git diff (see the differences, can be real long)
  5. git add . (this stages your changes, you can cherry pick with git add myfile.txt for instance)
  6. git commit -m 'Changes made' (this commits locally)

Then if you use a remote service like github or BitBucket you would push to remote with

git remote add origin http://IP/path/to/repository (only once no need to do each time)
git push origin master

In order to revert, you first look at the commits:

git log

then you jump to the commit with

git reset --hard sshcommitNumber

More on this there How to revert Git repository to a previous commit?

Everts
  • 10,408
  • 2
  • 34
  • 45
0
  1. Just commit changes, they will be saved on your local repository.
  2. you can revert commits, to remove some changes or checkout any commit to return to commited state of project.

In Editor Settings set Asset Serialisation to Text, that allow You to see all the changes you have made in your project.

Woltus
  • 438
  • 4
  • 14