git

Introduction

Introduction

git init

HEAD,origin,remote,local,name of main branch (main aka master)

add; commit; stash; checkout

.git/ folder

single dev using production machine:

git commit: a flag adds files which have been already added but are modified. doesnt add new files

reset hard

git status

git checkout specific branch, force?

".gitconfig" file

git: + return a file in git to last commit: git checkout – file.txt + HEAD is most recent checkout + git checkout HEAD

git diff: look at changes that will be commited before doing a commit

Setting up a remote server

git fetch

pull

Managing multiple contributors

rebase

dealign with clashes

merge,

reset

fast forward (fast forward and non-fast forward are merge variants)

squash?

git blame

Managing multiple branches

git branch [branch name] (makes new branch)

reflogs

git-lfs

Git server

Hooks

+ ./git/hooks directory exists by default in project. anything in there without an extension is a hook. examples with extension are there by default. + types of hook: pre-commit; prepare-commit-msg; commit-msg; post-commit + page on server side git. server side git hooks.