---
layout: default
navsection: userguide
title: Working with an Arvados git repository
...
{% comment %}
Copyright (C) The Arvados Authors. All rights reserved.
SPDX-License-Identifier: CC-BY-SA-3.0
{% endcomment %}
This tutorial describes how to work with a new Arvados git repository. Working with an Arvados git repository is analogous to working with other public git repositories. It will show you how to upload custom scripts to a remote Arvados repository, so you can use it in Arvados pipelines.
{% include 'tutorial_expectations' %}
{% include 'tutorial_git_repo_expectations' %}
{% include 'notebox_begin' %}
For more information about using Git, try
$ man gittutorial
~$ git config --global user.name "Your Name"
~$ git config --global user.email $USER@example.com
https://git.{{ site.arvados_api_host }}/$USER/tutorial.git
git@git.{{ site.arvados_api_host }}:$USER/tutorial.git
~$ cd $HOME # (or wherever you want to install)
~$ git clone https://git.{{ site.arvados_api_host }}/$USER/tutorial.git
Cloning into 'tutorial'...
~$ git config 'credential.https://git.{{ site.arvados_api_host }}/.username' none
~$ git config 'credential.https://git.{{ site.arvados_api_host }}/.helper' '!cred(){ cat >/dev/null; if [ "$1" = get ]; then echo password=$ARVADOS_API_TOKEN; fi; };cred'
~$ cd tutorial
~/tutorial$ git checkout -b tutorial_branch
~/tutorial$ mkdir crunch_scripts
~/tutorial$ cd crunch_scripts
~/tutorial/crunch_scripts$ nano hash.py
Add the following code to compute the MD5 hash of each file in a collection
~/tutorial/crunch_scripts$ chmod +x hash.py
Next, add the file to the git repository. This tells @git@ that the file should be included on the next commit.
notextile. ~/tutorial/crunch_scripts$ git add hash.py
Next, commit your changes. All staged changes are recorded into the local git repository:
~/tutorial/crunch_scripts$ git commit -m "my first script"
~/tutorial/crunch_scripts$ git push origin tutorial_branch