GitSync-applescript icon indicating copy to clipboard operation
GitSync-applescript copied to clipboard

Auto Init repo items that are not inited

Open eonist opened this issue 10 years ago • 7 comments

The case:

  1. You add a repo item in repo.xml
  2. The repo exists only on GitHub, No local git project
  3. 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

eonist avatar Aug 22 '15 11:08 eonist

test this:
[email protected]:eonist/testing.git

eonist avatar Aug 23 '15 15:08 eonist

returns "Not a git repository (or any of the parent directories): .git" if a folder has no git

eonist avatar Aug 23 '15 15:08 eonist

cd .git "-bash: cd: .git: No such file or directory"

eonist avatar Aug 23 '15 15:08 eonist

Assert if the folder has a git repo GitAsserter's is_git_repo("~/testing/.git/")--true/false

eonist avatar Aug 23 '15 18:08 eonist

You should be able to clone into a defined path:
git clone

eonist avatar Aug 27 '15 07:08 eonist

To manually clone a populated folder:

  1. git init
  2. add and commit your files
  3. attach remote origin

Then do the exact same steps as you do in the "Merge local to remote workflow"

eonist avatar Sep 05 '15 20:09 eonist

image

Activity diagram of the auto init operation.

eonist avatar Sep 07 '15 10:09 eonist