GIT – Intro

Installation and Configuration

  • Install git, open Github account
  • Configure git locally
    • user.name
    • user.email
    • core.editor
  • Check your configuration:
    • git config -e
    • git config –global –list

Testing a simple repository

  • Create a new repository
  • Add a file test.c
#include<stdio.h>

void main(void)
{
    puts("hello ver 1");
}
  • Build it
# gcc -o myapp ./test.c
  • Add .gitignore file with the executable name  (myapp)
  • Create a new git repository
  • Add and commit the files
  • Create 2 versions (2.0, 3.0) and commit them.
  • Move to version 2.0 – build and run
  • Move to latest version – build and run

 

Commands reference:

# git config
# git init
# git status
# git log --all
# git add .
# git commit -m "message"
# git checkout