开发者

Git commit to Dropbox repository issues

I'm trying to work on a project with some team members and we are using git as our source control. Our central repository is on Dropbox, which we all have access to.

I'm new to git, but I found some instructions on here to help get it all set up. For me it's working but for my team mates when they try to commit/push it doesn't update the file. Here's the steps we've followed:

I did this:

~/project $ git init
~/project $ git add .
~/project $ git commit -m "first commit"
~/project $ cd ~/Dropbox/git

~/Dropbox/git $ mkdir source.git
~/Dropbox/git $ cd source.git
~/Dropbox/git $ git init --bare
~/Dropbox/git $ cd ~/project

~/project $ git remote add origin ~/Dropbox/git/source.git
~/project $ git push origin master

Then on my computer I created tes开发者_Go百科t.txt, put some stuff in it, did:

~/project $ git add .
~/project $ git commit -m "second commit"
~/project $ git push

The changes got put from my computer to the Dropbox repository.

Now I told my friends to do this:

~/Desktop $ cd ~/project
~/project $ git clone -o dropbox ~/Dropbox/project/source.git

Then they got all the files on their computer, but when they update test.txt, commit and push, the Dropbox test.txt file isn't updated. The .git files are updated to show the new commit, but the repository's test.txt file doesn't show any changes.

What are we doing wrong? Thanks!


You are doing nothing wrong, that is just, how git works. The repository (basically the .git) directory and the working copy (the files you edit) are two different things. push only updates the repository, but not the working copy. The working copy is for good reasons never updated automatically (image, you'd loose your work, just because your co-worker pushed to your repository).

Read the Git documentation about hooks, to install a post-receive hook, which updates the working copy.


Do not use the Dropbox for a git repo. You will eventually have conflicts in individual files that will be impossible to resolve. Use a real git repo like unfuddle.com, github, etc.

Beyond that, run through a git tutorial when posible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜