# 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:


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 git@hpcgitlab.inl.gov:<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 git@hpcgitlab.inl.gov:<username>/bison.git. Thus origin points to git@hpcgitlab.inl.gov:<username>/bison.git.

Create a second remote to point to upstream as follows:




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




## 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: