VisIt with Git

Notes on using git svn for Visit development

Basic workflow: Use git as a private copy of the repo, and to take advantage of git's nice branching capabilities.

git clone https://github.com/visit-vis/VisIt.git
cd VisIt

List all branches

git branch -a

Checkout branch (Creates new one if name does not exist)

git checkout mybranch

Stay up to date with any changes:

git pull (--rebase if you want to push the history of your local branch forward and put your local changes above them. rebase can be dangerous as it rewrites history and should be used with care)

Develop / make changes (git add, git commit,etc)

  Examples: git add files_to_add
            git commit -m "Message for commit" files_to_commit
            git commit -am "Message and commit for any modified files"

Push changes (on master).

  After git commit your changes.
  git push (if someone else has made commits, git pull first)

Merge changes from local branch to master)

  from master branch: git merge mybranch

Push changes (share branch to remote repository)

  git push -u origin mybranch (will make branch available to remote repo) 

Delete branches (when done with work):

  from master branch: git branch -D mybranch

Reset changes:

   git reset --hard <sha-number>(reset back to blank state, very destructive. Options include --hard, --mixed, --soft allowing one to not lose changes)

Temporarily Save Work:

   git stash (allows one to save current work. I often use this in conjunction with local branch)

Other helpful but dangerous options:

   git clean -dfx (delete all files not belonging to the repo. Really effective for cleaning up your repo)
   git cherry-pick (pick out commits from other branches and include in your current work)
   git rebase <master> (from a branch) move the history of your branch forward so that any new issues don't pop up.

External Collaborators, Quality Control.

   Fork repository (master or branch)
   Make changes to your repo
   Click pull request.