- why git?
- where to host?
- what do you need to run?
- set up your account
- ssh
- config name
- Concept of code version
- Organization of commits
- Branch
- source tree
- pull request
- init repository
.gitignore
.git/
folder- adding files
- first commit
git log
- create repository
- add new repository
- push repository
- push to new repository
- merge
- rebase
- resolving conflict
git init
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
vim .gitignore
Ignore bundler config.
/.bundle
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
/node_modules
/yarn-error.log
/public/assets
git add .
git commit -am 'first commit'
git log
git remote add <REMOTE_NAME> <REMOTE_ADDRESS>
git push <REMOTE_NAME> master
git checkout -b <BRANCH_NAME>
# ...
# make some new code or some file change
# commit your code
# ...
git checkout master
git merge <BRANCH_NAME>
git checkout -b <BRANCH_NAME>
# ...
# make some new code or some file change
# commit your code
# ...
git checkout master
git rebase <BRANCH_NAME>
git pull <REMOTE_NAME> <BRANCH_NAME>
# ...
resolve conflict
# ...
git add .
git commit -am "<COMMIT_MESSAGE>"
git pull --rebase <REMOTE_NAME> <BRANCH_NAME>
# ...
resolve conflict
# ...
git rebase --continue
git checkout <FILE_NAME>
git rebase --abort
Be careful, use when it's necessary. it's came back to commit hash and ignore the rest
git reset HARD <COMMIT_HASH>
Back 1 commit
git reset HARD ~1
git push -f <REMOTE_NAME> <BRANCH_NAME>