Software Resource - Fall 2020
  • Introduction
  • Anaconda
    • Getting started
    • Managing conda environments
      • Using Navigator
      • Using Terminal
      • Issues using zsh shell
    • Jupyter Notebook
  • Finite Element (FEniCS)
    • Getting started
    • Tutorial
  • Black Box (ML libraries)
    • Tensorflow
    • Pytorch
    • Scikit-learn
    • GPU acceleration
  • Version Control (Git)
    • Getting started
Powered by GitBook
On this page
  • On this page:
  • Installation & Guide
  • General Idea & Basics
  • .gitignore file
  • GitHub: Remote Repositories

Was this helpful?

  1. Version Control (Git)

Getting started

Git is a popular version control system that allows you to save and access histories of files. Git is great for tracking & testing multiple versions of code and for collaborative coding.

PreviousScikit-learn

Last updated 4 years ago

Was this helpful?

On this page:

Installation & Guide

Follow the directions here to install git:

General Idea & Basics

Git lets you use branches to test new features/code while keeping a clean record on the main master branch. This functionality is great: if the experimental feature is unsuccessful, it doesn't effect the copy on the master branch; otherwise, if successful, it can be merged back into the master branch.

.gitignore file

List the directories and files (e.g. big data files, private info/keys, virtual environment directory, etc.) that you don't want to track with git in a file named .gitignore.

GitHub: Remote Repositories

GitHub is really popular for hosting remote Git repositories. Create an account on GitHub:

To create a local git repository, run git init in the desired directory. To add or update files in the local repo, first use git add <filename> to add individual files or git add . to add all files (excluding those in ). This moves the updated files into the staging area and you can check the status using git status. Then, commit these changes to the local repo using git commit -m <message> and you can check commit history with git log.

To collaborate, you would want to set up a remote repository on . To update the files on the remote repo, use git push. To update your local repo (e.g. when a collaborator has edited something in the remote repo), use git pull. Be sure to use git pull before git push, and if there is a conflict, you may need to merge the code before pushing onto the remote repo.

.gitignore
GitHub
Installation & Guide
General Idea & Basics
GitHub
Git Guides - install gitGitHub
GitHub: Where the world builds softwareGitHub
Logo
Logo
https://nvie.com/posts/a-successful-git-branching-model/
https://medium.com/@gagansuneja