将git与Dropbox文件夹中的项目一起使用 [英] Using git with a project in a Dropbox folder
问题描述
我在多台PC上工作。为了解决这个问题,我总是在Dropbox文件夹下工作,这意味着无论我走到哪里,我都可以从任何一台PC上拿取我从哪里离开的地方。
这似乎会导致问题为Git。以下是我在做的事情: 如何解决此问题而不会失去在工作站之间切换或使用git? 我也将这个项目推向Github。我正在开发一个CMS,所以我混帐忽略了所有不会改变的核心CMS文件。我的回购仅包含定制到项目的文件。这意味着我不能只是扯回购,因为它会丢失所有的CMS文件,但将整个CMS和所有资产包括在回购中似乎毫无意义。
<只是要清楚,我并不想使用Dropbox作为远程回购,这是我能在Google上找到的。我正在处理的实际项目位于Dropbox文件夹中,我的远程仓库位于GitHub上。
我尝试过使用git几次,但永远不会找到一个可行的工作流程。如果有人能帮助我,我会很感激。
谢谢
这听起来像是一个非常糟糕的主意,从一些谷歌搜索中,听起来您可能会破坏您的回购。
'正确'这样做的方法是使用开发分支。
当您在一个工作站上完成工作时,将所有内容提交/推送到开发分支。
随着功能的发布,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:
- Add some files
- git add .
- git commit -m "Files added"
- git status: No changes to commit
- Let Dropbox sync up
- Switch to another PC
- Let Dropbox sync down
- 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屋!