LNCD

Table of Contents

  • LNCD Home
  • Administration
  • Notebooks
  • Journal Club Presentations
  • Publications
  • Current Projects
  • Completed Projects
  • Current Grants
  • Datasets by Project
  • Brain ROIs and Measures
  • ️Tools And Methods
  • Big Data
  • RA Homepage
  • Recent Changes
  • Maintenance
  • Site Map
  • Random Page
LNCD
Docs » Git

This is an old revision of the document!


Git

git is a “distributed version control system” (dVCS) or “source control management” (SCM) tool used to track changes, primarily for source code in text files. git has command line and graphical interfaces.

Alternative SCM tools include fossil, hg, pijul.

git is not github. Github is a Microsoft-owned source forge adding a social network, identity services, and other features not included in the git system (issue tracking, patch/fork management). Other forges include gitlab, sr.ht, codeberg.

For more see

  • https://happygitwithr.com/
  • https://git-scm.com/doc

Using

On the command line in terminal/with shell, using git follows the add,commit,push pattern:

git add $file   # move changes in $file to "staging"
git commit      # annotate staged files, commit to history
git push        # send changes to a server (e.g. github)

By default, git commit will open Vim to use to write the commit message.

  1. Push i to put vim in insert mode.
  2. write your message.
  3. push Esc to go back to command mode
  4. :wq to write and quit.

Github https push

To push to https (vs ssh like git@) repos, you'll need to use a personal authentication token when prompted for a password. See github's documentation

ssh push

git push can use ssh authentication. You need a key likey in ~/.ssh/id_rsa.pub. If that doesn't exist, ssh-keygen can make it (use empty password for convience. hit enter at password prompt to leave blank). See more documentaiton on github

Previous Next