将git与Dropbox文件夹中的项目一起使用 [英] Using git with a project in a Dropbox folder

查看:103
本文介绍了将git与Dropbox文件夹中的项目一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在多台PC上工作。为了解决这个问题,我总是在Dropbox文件夹下工作,这意味着无论我走到哪里,我都可以从任何一台PC上拿取我从哪里离开的地方。



这似乎会导致问题为Git。以下是我在做的事情:

  • git commit -m添加文件

  • git status:无需更改提交

  • 让Dropbox同步
  • li>
  • 切换到其他PC

  • 让Dropbox同步

  • git status:列出在其他PC上添加的所有文件, '修改'即使它们不是

    如何解决此问题而不会失去在工作站之间切换或使用git?



    我也将这个项目推向Github。我正在开发一个CMS,所以我混帐忽略了所有不会改变的核心CMS文件。我的回购仅包含定制到项目的文件。这意味着我不能只是扯回购,因为它会丢失所有的CMS文件,但将整个CMS和所有资产包括在回购中似乎毫无意义。



    <只是要清楚,我并不想使用Dropbox作为远程回购,这是我能在Google上找到的。我正在处理的实际项目位于Dropbox文件夹中,我的远程仓库位于GitHub上。



    我尝试过使用git几次,但永远不会找到一个可行的工作流程。如果有人能帮助我,我会很感激。



    谢谢

    解决方案

    这听起来像是一个非常糟糕的主意,从一些谷歌搜索中,听起来您可能会破坏您的回购。



    '正确'这样做的方法是使用开发分支。
    当您在一个工作站上完成工作时,将所有内容提交/推送到开发分支。

    然后在第二个工作站上,取下这个分支并继续。

    p>

    随着功能的发布,cherry-pick /将相关的提交压缩到一个发布版本(通常是master)的分支中。

    I'm struggling with a git project in a Dropbox folder.

    I work across multiple PC's. To get around this I always work out of a Dropbox folder, this means wherever I go on whatever PC I can pick up where I left off.

    This seems to cause problems for Git. Here's what i'm doing:

    1. Add some files
    2. git add .
    3. git commit -m "Files added"
    4. git status: No changes to commit
    5. Let Dropbox sync up
    6. Switch to another PC
    7. Let Dropbox sync down
    8. git status: Lists all files added on other PC as 'modified' even though they haven't been

    How can I get around this behaviour without losing the ability to switch between workstations or use git?

    I am also pushing the project to Github. I'm developing within a CMS so i've git-ignored all of the core CMS files that are never going to change. My repo only contains the files that are bespoke to the project. This means I can't just git pull the repo because it will be missing all the CMS files but it seems pointless to include the whole CMS and all the assets in the repo.

    Just to be clear i'm not trying to use Dropbox as a remote repo which is all I can find on Google. My actual project that i'm working on is in a Dropbox folder, my remote repo is on GitHub.

    I've attempted to use git a few times but can never find a workflow that works. If someone could help me out here i'd be grateful.

    Thanks

    解决方案

    This sounds like a very bad idea, and from a bit of Googling, it sounds like you can potentially corrupt your repo as well.

    The 'Right' way to do this, would be to use development branches. When you finish work on one workstation, commit/push everything to a development branch.

    Then on the second workstation, pull this branch and continue.

    As features become ready, cherry-pick/squash the relevant commits into a release (usually master) branch.

    这篇关于将git与Dropbox文件夹中的项目一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆