Short question:
Is there tricks from
git
, (or command-line/Git-bash
/WSL
_on_Windows), such that I will be hosting the git-repo locally, in wherever I prefer, and have only the real files synced two-ways between the local git-repo and a Dropbox folder?Even shorter: is there a way to push from a local repo to a Git remote, and have the files stay "two-way-synced" to a Dropbox folder before and after the push?
At the end of the day, I would like to keep pushing to the remote git-repo as usual. I will push shortly after committing, and would prefer all file-contents from the two sources (the Dropbox folder and the local copy of the Git-repo) to stay synced before and after the commit-push activities. (I am less confident here as this may go against the philosophy of "staging" my works per each commit.)
Clarification: I do not intend to do anything fancy with Git. I prefer to keep working with the same branch, and to pull/push from/to the same Github repo as the remote. In particular, I will need to get things to work on multiple PCs and a Linux machine.
Unsuccessful attempts:
- First, I think it is a bad idea to initialize a git-repo inside the
~/Dropbox
folder, as it creates clutters and thereby, likely, conflicts. - I have thought about creating a "Selective-sync" through the Dropbox GUI to simply exclude the
.git
folder. Yet, without such.git
folder, it is unclear how to establish the local repo on all computers of mine (I do use multiple Windows PC and one more Linux box). - I am not good at
symlink
, and have been playing with it a good number of times but failed. If someone were to suggest it, please be precise. Also, I would need it to work across multiple Windows machines and Linux box. I am happy to add more details as long as I get a working demo from you.
Backgrounds
Thankfully, my collaborators has improved from the emailing habit of handing off drafts and work-in-progress through piles of zip-files. Nowadays, they are happy with a shared Dropbox folder. Yet, they haven't started to care too much about version control. Quotes from them: "Git on the command-line? It is a joke?" lol.
On the other hand, I have been happy with pushing to Github as my remote repo, and have been doing so for a good number of years. I am used to my git commands, and have devised the following alias
settings to do so quickly.
alias ga='git add -A'
alias gs='git status'
alias gc='git commit -m'
alias gp='git push'
alias gpp='git pull'
I am looking for a way to use Git(Github) and Dropbox in harmony. And I am aware of the following knowledge:
- How to use
git
occasionally when hosting everything on Dropbox ==> I am not a paid user of Dropbox, and my projects may easily overgrow my limit. - Details on Git and Github
- Brilliant notes on using Dropbox as a Git (remote) repository
- Super convening marking material to pull people from Dropbox to Git (Github)
Among the three unsuccessful attempts on my end, I am inclined to believe some symlink
command (or complicated scripts) will do the trick. Looking forward to further instruction from the community. I am tagging as many vision control