Pushed to git bare repo and I can't pull changes from other machines

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 06:31:49

问题


I have a git repo on my Dropbox,

I am using Ubuntu,

I have a project which I've cloned via

git clone blablabla/Dropbox/blablabla.git

and I've pushed for like 500 times to that but all I can pull now from another machine is like first 400

also my blablabla/Dropbox/blablabla.git file is smaller than my local

/var/www/blablabla/.git

so I guess some files aren pushed and so it seems when I've cloned

blablabla/Dropbox/blablabla.git

from another machine

so how can I properly push now on the first machine so I can pull from the second

I also have branches

plus git push dropbox shows Up to date

Help?

I think I can put that

/var/www/blablabla/.git

on dropbox and clone that but what have I did wrong on the first machine plus I want to be able to normally push so it makes changes, this worked some time before (I have some changes but last 100 commits lost)


回答1:


my blablabla/Dropbox/blablabla.git file is smaller than my local /var/www/blablabla/.git

Of course: the first one is a bare repo (for you want to push to it).
The second one is a non-bare repo, with a working tree above it. It can include more unpacked elements in it.

Using Git with Dropbox is dangerous:

  • "Git with Dropbox Issues"
  • "Dropbox: use bundles" (as in here)
  • "Backup a Local Git Repository"

Yes, you cannot push to a bundle, but you can quickly create an incremental bundle to exchange the latest commits (I mention scripts in this answer).

Regarding missing commits, and git push dropbox showing "up to date", check that you are currently on a valid branch (git branch), and not in a detached head.



来源:https://stackoverflow.com/questions/26565754/pushed-to-git-bare-repo-and-i-cant-pull-changes-from-other-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!