0
Answer

Cannot attach ms sql server database after syncing using git

Ask a question
tuanbs

tuanbs

10y
1.1k
1

I have a problem attaching ms sql server database after syncing with git. My steps are:
1. I use Dropbox to keep the bare repository instead of github.
2. The working repository stored in C drive. This repository contains my code and database (ms sql server 2008). So I commit and push changes to bare repository (in dropbox).
3. On the second computer, I clone that project from dropbox (bare repository).
4. At first, the 2nd computer can attach database. Then it edits database, detach database, and push changes to bare repository in dropbox.
5. The problem occurs here, the first computer cannot pull the changes from bare repository. It shows permission deny. I use SmartGit as GUI for git. Beside, when I do these steps again, the other problem is that the first computer can pull the changes but it cannot attach the database any more.

I guess when the second computer edits database, it gave its own permission to access database, that's why the first one cannot get changes or attach database.

The purpose of the above steps is that I want to keep my database in dropbox using git so that I can work with database from any computer without copying it. Before I used Dopbox to do this, but it cannot sync database, that's why I think of using git. I do not need git to version control my database, just keeps it in one place for portable working.

If you guys think the above method is not practical, could you suggest me a way of doing this? Thank you so much in advance.