Developing Cloverleaf with GitHub

This is a demo with limited git commands in GitHub context. This shows Cloverleaf application development with GitHub to initialize GitHub-oriented Cloverleaf application development.

  1. Move to the Cloverleaf root environment, and run git init.
    C:\cloverleaf\cis20.1P\integrator>setroot
    No default site -- no site set
    C:\cloverleaf\cis20.1P\integrator>setsite helloworld
    
    C:\cloverleaf\cis20.1P\integrator>git init
    Initialized empty Git repository in C:/cloverleaf/cis20.1P/integrator/.git/
  2. Use hcigitinit in $HCIROOT/bin as the helper to generate the root-level .gitignore , .gitattributes, and site-level .gitignore for GitHub. A context of these files is generated by hcigitinit and is placed in these files.
    C:\cloverleaf\cis20.1P\integrator\sbin>hcigitinit -h
    hcigitinit [options]
    Options:
       --root|-r    Cloverleaf rootpath, e.g. /opt/cloverleaf/cis20.1/integrator
       --site|-s    Cloverleaf sitename(s), e.g. helloworld,testprod
       --help|-h    Help
     Notes:
        To populate Cloverleaf Root and Site(s) GitHub .gitignore and .gitattributes
        if option root is not specified, try $ENV{'HCIROOT'} instead, if option site(s)
        is not specified,  will try $ENV{'HCISITE'}; Otherwise it does nothing and exits.
    C:\cloverleaf\cis20.1P\integrator
    C:\cloverleaf\cis20.1P\integrator\sbin>showroot
    HCI root is C:\cloverleaf\cis20.1P\integrator
    HCI site is helloworld
    C:\cloverleaf\cis20.1P\integrator\sbin>hcigitinit
    ### Working for the root
    ###  C:\cloverleaf\cis20.1P\integrator
    ### and site(s)
    ###  helloworld
    *** C:\cloverleaf\cis20.1P\integrator\.gitignore already exists, being archived
    ### Generating C:\cloverleaf\cis20.1P\integrator\.gitignore
    *** C:\cloverleaf\cis20.1P\integrator\.gitattributes already exists, being archived
    ### Generating C:\cloverleaf\cis20.1P\integrator\.gitattributes
    ### Appending helloworld to C:\cloverleaf\cis20.1P\integrator\.gitignore
    *** C:\cloverleaf\cis20.1P\integrator\helloworld\.gitignore already exists, being archived
    ### Generating C:\cloverleaf\cis20.1P\integrator\helloworld\.gitignore
  3. Windows EOL-style Cloverleaf configurations bring the problem to non-Windows Cloverleaf application runtimes. To ease this gap, use git config to set core.autocrlf to "true" on Windows .
    git config --global core.autocrlf true
  4. In the integrator directory:
    1. Add the artifacts using git add.
    2. Show the add status using git status.
    3. Use git commit to the local repository.
    C:\cloverleaf\cis20.1P\integrator>git add . 
    :
    C:\cloverleaf\cis20.1P\integrator>git status
    On branch master
    
    No commits yet
    
    Changes to be committed:
      (use "git rm --cached <file>..." to unstage)
    	new file:   .gitattributes
    	new file:   .gitignore
    	new file:   Alerts/sample.alrt
    	new file:   AppDefaults/GenericApp
    . . . .
    C:\cloverleaf\cis20.1P\integrator>git commit -m "init root and sites for github practice"
    [master (root-commit) a7b9758] init root and sites for github practice
     700 files changed, 89989 insertions(+)
     create mode 100644 .gitattributes
     create mode 100644 .gitignore
     create mode 100644 Alerts/sample.alrt
     create mode 100644 AppDefaults/GenericApp
    . . . .
  5. Run git remote add and git push.
    C:\cloverleaf\cis20.1P\integrator>git remote add origin git@github.com:youraccut/yourgithubrepo.git
    
    C:\cloverleaf\cis20.1P\integrator>git push -u origin master
    :
    remote: Resolving deltas: 100% (65/65), done.
    To github.com:youraccut/yourgithubrepo.git
     * [new branch]      master -> master
    
    You can also use git branch and git push after git remote add.
    C:\cloverleaf\cis20.1P\integrator>git remote add origin git@github.com:youraccut/yourgithubrepo.git
    
    C:\cloverleaf\cis20.1P\integrator>git checkout -b dev
    Switched to a new branch 'dev'
    
    C:\cloverleaf\cis20.1P\integrator>git branch -a
    * dev
      master
      remotes/origin/dev
      remotes/origin/master
    
    C:\cloverleaf\cis20.1P\integrator>git push
    fatal: The current branch dev has no upstream branch.
    To push the current branch and set the remote as upstream, use
    
        git push --set-upstream origin dev
    
    
    C:\cloverleaf\cis20.1P\integrator>git push --set-upstream origin dev
    Everything up-to-date
    Branch 'dev' set up to track remote branch 'dev' from 'origin'.