GitSync-applescript
GitSync-applescript copied to clipboard
Auto Init repo items that are not inited
The case:
- You add a repo item in repo.xml
- The repo exists only on GitHub, No local git project
- No local folder at the local path you specified in the repo.xml
The solution:
the path does not exist OR the the path exists and the folder is empty
git clone remote_url local_dir
the path exists, but the folder is not empty
GitUtil's manual_clone(remote_url,local_path)
has git folder
does not have remote repo attached
attach remote repo
does have remote repo attached
determine what to do next, download or upload or both. conflicts? solve this
does not have .git folder
use git init
attach remote git to local git
ahh just write the above in Atom, too many clauses
test this:
[email protected]:eonist/testing.git
returns "Not a git repository (or any of the parent directories): .git" if a folder has no git
cd .git "-bash: cd: .git: No such file or directory"
Assert if the folder has a git repo GitAsserter's is_git_repo("~/testing/.git/")--true/false
You should be able to clone into a defined path:
git clone
To manually clone a populated folder:
- git init
- add and commit your files
- attach remote origin
Then do the exact same steps as you do in the "Merge local to remote workflow"

Activity diagram of the auto init operation.