Dropbox will always try to sync saved files, even those you are still working on. Why do you store a repo inside dropbox? It is not better to store my project folder straigth into Dropbox?Ī. That’s probably because you forgot to enable meta files in your project settings. OMG! My project lost all the linkages set in the unity inspector!!!!11111ONEONEONEĪ. To avoid errors, you should always push and pull stuff with your editor closed. Is it safe to push/pull to/from repo while Unit圓D’s editor is open?Ī. Sometimes yes, for tiny projects and for projects where I always need a ‘local’ remote repo where there’s no internet connection available. because indexing deleted files (with -A) is completely useless before the first commit.Ī. A good explanation about those differences is explained in this StackOverflow question. I prefer using git add -A because it indexes removed files, while git add. Most tutorials out there use the command git add. I suppose yes, just skip Step 2 and it should work fine. Will this tutorial work with non Unit圓D projects?Ī. Remember to not push stuff from different location at the same time. Google Drive, Asus WebStorage and other similar services should work the same way. This is a basic setup, for anything more professional like a real git repo server, issue tracking and wiki functions you should look at BitBucket, which offers free unlimited (private or public) repository hosting for small teams (up to five devs).Ī. This because the entire git repo is shared over Dropbox and two git pushes at the same time will cause Dropbox to sync those pushes together, messing up your project data. While it will work well with small projects by small teams, I would not recommend using it with big files or more than 2-3 developers. Remember to push/pull/merge stuff on all synced computers. Now on our first pc we can get the changes made on the second one by pulling stuff Git commit myscript.cs -m 'modified a file' To push back stuff, add them to a local commit and push them like we did earlier. Now play around and modify some stuff and code. Git clone ~/Dropbox/myGitProject myLocalClone NOTE: in the first line i set my working folder to home folder, you should set a folder where you usually store your projects like ~/Documents/Unity or ~/Projects Now on your second pc / other dev pc clone the remote repo Step 5: Cloning and pushing from another pc If you want to sync across different computers keep reading. Git remote add origin ~/Documents/Dropbox/myGitProject Keeping the bash open in our local project folder, let’s link the remote dropbox repo by using: Open your git bash again and navigate to your project folderĪdd all the needed files to your git repo using (the unneeded files are automatically discarded by out. This file will tell git to ignore those files, since those are not needed when syncing. gitignore (be sure to include the dot), open it in Notepad or your app choice and paste this block inside it. NOTE: your project root folder is the one which contains Assets, Library and ProjectSettings folders. Open your explorer and navigate to your Unit圓D project root folder. In Unit圓D editor, create or load a project, then go to Project-Settings>Editor and under Version Control>Mode select Meta Files. If you are not using Unit圓D or if you followed my previous Git and Unit圓D tutorial, you can skip to step 3. Once we are here, we’ll make a new folder and create a new bare repo inside it. This location may vary depending on your configuration. Step 1: Creating a bare remote repository in your Dropbox folderįirst, using git bash let’s navigate to our Dropbox folder. Today I will show you how to store a git repository right in your Dropbox folder. My previous tutorial about Git and Unit圓D used a virtual machine for keeping git repos, setting up correctly a VM is hard stuff for some, so i decided to make an easier tutorial on the matter. Sometimes I think I look a bit obsessed by revision control, but i really find those notes are the only ones worth writing down.
0 Comments
Leave a Reply. |