An Introduction to Version Control and GitHub
2026-03-13
which git returns a path, otherwise see install on Linux or install on macOS, respectively.push to your repositories.viz_my_data.pyviz_my_data_v1.pyviz_my_data_final_v2_stable.pySections of a Git project (adapted from Pro Git).
git init
git clone <repo url> [<dir>]
$ # Alternatively, replace url with your forked url
$ git clone git@github.com:jfdev001/git-for-everyone-miniweather.git
Cloning into 'git-for-everyone-miniweather'...
remote: Enumerating objects: 2200, done.
remote: Counting objects: 100% (2200/2200), done.
remote: Compressing objects: 100% (618/618), done.
remote: Total 2200 (delta 1594), reused 2176 (delta 1574), pack-reused 0 (from 0)
Receiving objects: 100% (2200/2200), 8.44 MiB | 379.00 KiB/s, done.
Resolving deltas: 100% (1594/1594), done.git init
git add <filepath>
git clone <repo url> [<dir>]
git status
git init
git add <filepath>
git commit [-m "short message here"]
git clone <repo url> [<dir>]
git status
git log
$ git log
commit 8f07f0cacba3518219d5630d8a95b291ff4ebe3e (HEAD -> main)
Author: Jared Frazier <cscidev001@gmail.com>
Date: Thu Mar 12 10:45:47 2026 +0100
add a new file
commit 9584a0cf4f360a50e0981debc7e0256d0e39aadb (origin/main, origin/HEAD)
Author: Jared Frazier <frazier@iap-kborn.de>
Date: Wed Mar 11 15:39:32 2026 +0100
add docker pull instructionsgit init
git add <filepath>
git commit [-m "short message here"]
git push <remote> <branch>
git clone <repo url> [<dir>]
git status
git log
$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 12 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 274 bytes | 274.00 KiB/s, done.
Total 3 (delta 1), reused 1 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To github.com:jfdev001/git-for-everyone-miniweather.git
9584a0c..8f07f0c main -> mainA colleague has written a Fortran application that simulates fluid-dynamic flows:
If you have an account, then fork (upper right corner) the repository and clone your fork.
If you do not have an account, just clone my repository.
git clone <repo url>git addgit statusgit commit [-m "your message here"]git push
git logrequirements.txt)README.md that could be moved into a new file (hint: bottom of README.md)?.gitignore aren’t added to Git history)commit work, Git stores it as a diff.
+/-)git diff shows before staging, if you want. to see the diffs for staged (i.e., after git add) files, do git diff --staged.diffs are stored in a tree, by reconstructing diffs you can reconstruct files, and thus the “snapshot” of your files at a particular state of development.
Sections of a Git project (adapted from Pro Git).
miniweather simulation?main branch for all commits. git branch <branch name>
git checkout <branch name>
git merge <branch name>
git merge featureBranches facilitate concurrent feature development and project organization.
build_output directory.miniweather/build/ called clean_build_output that does this for us.git add and then commit your changes.push your new branch to your remote repository.main branch and inspect the git log and git branchs.git branch [<branch name>]git checkout <branch name>git addgit commitgit push -u origin <new branch name>main on GitHub.From branch(es) you pushed in the previous exercise open a pull request to either:
main branch of my repository.main branch of your fork.Then try and merge what you’ve done.
If there are merge conflicts try to resolve them.
Sections of a Git project (adapted from Pro Git).
Get in touch:
git@github.com[<repo>].git# It's more secure to passphrase protect your SSH key, but up to you...
# for an empty passphrase, just hit enter after calling ssh-keygen
ssh-keygen -t ed25519 -f ~/.ssh/id_github_ed25519
cat ~/.ssh/id_github_ed25519.pub
# ^^ copy the above public key
# GitHub.com > Top Right Corner > Settings > SSH & GPG Keys > New SSH key
# then paste the public key above into the form on GitHub
# there are cleaner ways to do this, but activate your ssh agent like so:
echo 'eval $(ssh-agent -s)' >> ~/.bash_profile
echo "ssh-add ~/.ssh/id_github_ed25519" >> ~/.bash_profile
source ~/.bash_profile
# verify that you can connect to GitHub
ssh -T git@github.com