- Decentralised
- Everyone has their own local copy of the code
- can synchronize with server for collaboration
adding files into staging (included in the next commit)
git add readme.txt
git commit --message "add readme"
set the remote references in the git config file
- be called "origin"
- remote references are just URLs to your remote repository
retrieve any changes from the origin
perform two steps fetch and merge
transfers commits to the remote repo
git push -u origin feature-fakepartner
- 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)
get the status of current git
- i: insert mode
- esc: but to normal mode
- :x: enter to save
# Default ignored files
/shelf/
/workspace.xml
git diff main
git diff main..feature-fakepartner