Skip to content

Latest commit

 

History

History
81 lines (59 loc) · 1.28 KB

T1.md

File metadata and controls

81 lines (59 loc) · 1.28 KB

CS T1 Git

Architecture

  • Decentralised
  • Everyone has their own local copy of the code
  • can synchronize with server for collaboration

Add

adding files into staging (included in the next commit)

git add readme.txt

Commit

git commit --message "add readme"

clone

set the remote references in the git config file

  • be called "origin"
  • remote references are just URLs to your remote repository

fetch

retrieve any changes from the origin

pull

perform two steps fetch and merge

push

transfers commits to the remote repo

git push -u origin feature-fakepartner

branches

  • checkout is older, while switch is simpler
git checkout -b feature-a 

[//]: # (create branch for feature A if not exist)

git switch main

[//]: # (same as checkout main)

git switch -c feature-b

[//]: # (create branch for feature B if not exist)

git switch main && git merge feature-b

[//]: # (merge B)

git branch -d feathure-fakepartner 

[//]: # (delete branch)

CI/CP pipelines

status

get the status of current git

vim

  • i: insert mode
  • esc: but to normal mode
  • :x: enter to save

.gitignore

# Default ignored files
/shelf/
/workspace.xml

diff

git diff main
git diff main..feature-fakepartner