Go back to fan’s Miscellaneous Repository.
Search
Issue
Solution
How to sync both folders properly? Traditional option is submodule, do not use that, use subtree, which is a standard feature for git since v1.7.11.
# Project git folder in dropbox
cd "C:/Users/fan/Documents/Dropbox (UH-ECON)/Project Emily Minority Survey/Drafts_RR"
# Add new paper draft remote url to project git remote urls
# github main is project repo url, github_draft is overleaf synced folder
git remote -v
git remote add github_draft git@github.com:FanWangEcon/ChinaSchoolClosure.git
git remote -v
# Add subtree, Drafts_RR should not exist yet
git subtree add --prefix=Drafts_RR github_draft
git subtree add --prefix "C:/Users/fan/Documents/Dropbox (UH-ECON)/Project Emily Minority Survey/Drafts_RR" git@github.com:FanWangEcon/ChinaSchoolClosure.git master --squash
git subtree split --prefix=Drafts_RR/ -b ChinaSchoolClosure
Do not use submodule
$ git subtree add --prefix=Drafts_RR/ github_draft master
git fetch github_draft master
Enter passphrase for key '/c/Users/fan/.ssh/id_rsa':
warning: no common commits
remote: Enumerating objects: 235, done.
remote: Counting objects: 100% (235/235), done.
remote: Compressing objects: 100% (177/177), done.
remote: Total 235 (delta 110), reused 133 (delta 50), pack-reused 0
Receiving objects: 100% (235/235), 3.02 MiB | 3.58 MiB/s, done.
Resolving deltas: 100% (110/110), done.
From github.com:FanWangEcon/ChinaSchoolClosure
* branch master -> FETCH_HEAD
* [new branch] master -> github_draft/master
Added dir 'Drafts_RR'
fan@LAPTOP-55QHS6DU MINGW64 ~/Documents/Dropbox (UH-ECON)/Project Emily Minority Survey (master)
$ ls
Code/ Drafts/ Images/ notes.md 'Possible Questions and Answers.docx' > andbox/ Tables/
CodeEdccRR/ Drafts_RR/ Log/ onenote1.pdf presentation/ > choolConsolidation_main_sexHan_wlt.pdf 'Tables Old'/
comments/ 'eth disparities irb'/ 'Model Variables Graph Factory'/ onenote2.pdf 'R&R comments.docx' choolConsolidationDraft_V1.pdf
Data/ Feedback/ 'Notes and drafts, language'/ Planning.xmind README.md Submissions/
desktop.ini 'Government Documents'/ 'Notes and Papers'/ policies/ 'Reference papers'/ summer2014visitors/
fan@LAPTOP-55QHS6DU MINGW64 ~/Documents/Dropbox (UH-ECON)/Project Emily Minority Survey (master)
$ ls Drafts_RR
_bib/ _fig/ _tab/ draft_main.pdf draft_main.tex fragments/ preamble_main.tex sections/