DEV Community

uni928
uni928

Posted on

[Unity] A simple way to manage Git for personal development, even for Git beginners

Do you use GitHub for personal development?

It goes without saying that Git is a powerful tool for collaborative development, but it is also an excellent way to efficiently back up your work for personal development.

Backing up your work without using Git can be a very tedious task.

For example, suppose you have a 100MB project and edit a 6KB file.

If you back up the entire project again, the size of the backup will increase by 100MB.

Backing up only the edited files makes it difficult to manage old files.

That's why I would like you to use GitHub for personal development.

...But do you really need GitHub?

Let's think about it now.


Is GitHub really necessary?

I'll start with the conclusion.

Unless there's a specific reason,
if you're using Git for a personal development project,
I think it's OK to store Git locally.

I don't think you need to use GitHub.

If you just use Sourcetree,
I think it will reduce the amount of tedious work.

Integrating with GitHub
may not be that complicated,
but I don't see any big benefits.

I don't think there's any need to integrate with GitHub every time, especially for small projects such as testing.

Now, I'll show you the steps to work locally without using GitHub.


The minimum method for managing Git in personal development

The following steps are all you need.
Assuming you have already created a Unity project.

  1. Install Sourcetree. (First time only)
  2. Create a repository, Set up the "Assets" folder for your project.
  3. Commit and then operate as usual.

That's all you need to do.

If you select only the Assets folder, you don't need to set .ignore, and you don't often have to edit anything other than the Assets folder.

If you installed something with Package Manager, you can just reinstall it.

I think it's more of a problem for beginners to give up on Git because it's too complicated to set up a Git environment.

Git also requires many operations such as "pull" and "commit", which may scare beginners away.

However, if you remember only two operations, "commit (take a backup)" and "reset the current branch to this commit (load backup) (Hard)", you can make better use of it than not using it.

These operations are simple, so beginners should not hesitate to try them out.


Summary of required operations

The minimum required operations are

  1. Install SourceTree
  2. Create a repository
  3. Commit (take a backup)
  4. Reset the current branch to this commit (load backup) (Hard)

Of these, 2, 3, and 4 can be done in less than 20 seconds once you get used to it.

Git management is surprisingly easy if you limit it to the minimum necessary operations.


Summary

Above, I have introduced the minimum method for managing Git for personal development.

This article was written with the intention of making beginners not shy away from Git.

This method makes it easy to operate.
If you are not using Git, I would be happy if you would try this method first.

Git is a powerful tool even for personal development.
I would like beginners to try it out.

I hope this article will help you with your development.
Thank you for reading.


Addendum

I wrote an article explaining the specific steps.
It's in Japanese, so please use a translation tool to read it.
I hope you'll refer to this article and take a look at it if you fail.

https://qiita.com/uni928/items/8a560522e4ce1f2bdcde

It's probably best to try it yourself before reading the article above.
The article above is just a step-by-step guide.
It may not be useful for those who read this article to gain knowledge.
I think it's OK for only those who have tried it and failed to read it.

Top comments (0)