Git and


UF Research Computing

Matt Gitzendanner

What is git?

  • Version Control Software
    • Track changes to files
    • Collaborative
    • Track who made changes
    • Revert changes

What is

  • Commercial web site for hosting online git repositories
    • Free options
    • Education plans

Alternatives exist:

and more...

Why use version control?

  • Collaborate
  • History of changes
    • Revert changes
    • See what you did
    • Recover deleted bits
  • Experiment
    • Easy to try something
  • Backup
    • Remote copies

Geting started

Download and install git:



Title Text

git workflow

Create a repo on

My new repo

Create folder, copy/paste

[magitz@login3 ufrc_demo]$ echo "# ufrc_demo" >>
[magitz@login3 ufrc_demo]$ git init
 Initialized empty Git repository in /home/magitz/ufrc_demo/.git/
[magitz@login3 ufrc_demo]$ git add
[magitz@login3 ufrc_demo]$ git commit -m "first commit"
[master (root-commit) ed77e61] first commit
 1 file changed, 1 insertion(+)
 create mode 100644
[magitz@login3 ufrc_demo]$ git branch -M main
[magitz@login3 ufrc_demo]$ git remote add origin
[magitz@login3 ufrc_demo]$ git push -u origin main
Counting objects: 3, done.
Writing objects: 100% (3/3), 227 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
 * [new branch]      main -> main
Branch main set up to track remote branch main from origin.
[magitz@login3 ufrc_demo]$   



  • Diverge from the main line 
    • Keep main files unchanged
  • Test new ideas
  • Fix bugs
  • Develop new features
git branch workshop
git checkout workshop
git checkout -b workshop



  • Bring the changes from a branch back into main branch
  • May need to resolve conflicts
    • Changes made to a file in both branches


  • Branch and merge workflow

GitHub Learning Lab

GitHub Classrooms

GitHub Pages

Host your site at (for free)!

Additional Resources