Cloning Bison: Working with Git Repositories

Create a directory on the computer that you are using. We suggest 'projects' for convention, but you can name it anything

mkdir ~/projects

To clone Bison, enter the directory that was just made, cd ~/projects and enter the following git commands:

git clone<username>/bison.git ## copies your fork of Bison to your projects directory.
cd bison/ ## enter the newly created bison directory
git submodule update --init ## initializes any submodules that Bison depends on

Making Remotes

Remotes are nothing more than an alias for a path to a repository. They make git commands a little easier to deal with by typing one word instead of the complete path. origin, for example, could be the remote for<username>/bison.git.

By default the remote origin is made when you clone and points to the repository that you cloned from. These instructions had you clone from<username>/bison.git. Thus origin points to<username>/bison.git.

Create a second remote to point to upstream as follows:

git remote add upstream

Now you should have 2 remotes, origin that points to your personal Bison project and upstream that points to the idaholab Bison project. You can see your remotes with the commands

git remote show  ## will give a list of all remotes in your git repository
git remote show <remote> ## will shown the path to the specified remote

Finally, set your origin branch to track the idaholab/devel upstream branch

git branch --set-upstream-to=upstream/devel

Verify that your origin branch is both tracking the upstream repository and is up-to-date with respect to the upstream repository with

git branch -vv

Some Git Cleanup

In the bison directory enter the following commands to add your user information to your repository.

git config 'your name'
git config 'your email'

Cloning to a New Machine

Assuming that you have already forked Bison, it should be safe to say that you have HPC/Bison access already and know at least a little about the git and hpcgitlab process. The first time user instructions have you clone from your fork which was only the current Bison version when it was forked (most likely), and now your Bison fork is likely behind the current idaholab/devel branch. This lag in your Bison fork means that you must update your new Bison repository clone immediately. To clone to another or new machine:

git clone<username>/bison.git
git remote add upstream

### Update your new clone immediately to the current idaholab/devel state
git fetch upstream devel  ## pulls the updates from the devel branch of idaholab/bison
git rebase upstream/devel ## applies the updates from upstream/devel to your current local branch

## Initialize the submodules
git submodule update --init

As before you will end up with a current Bison repository and the 2 remotes origin and upstream.

Now build libMesh and Bison and test Bison following the instructions under Building Bison