- 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.comvim .gitignore
Ignore bundler config.
/.bundle
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
/node_modules
/yarn-error.log
/public/assetsgit add .
git commit -am 'first commit'git loggit remote add <REMOTE_NAME> <REMOTE_ADDRESS>
git push <REMOTE_NAME> mastergit 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 --continuegit checkout <FILE_NAME>git rebase --abortBe 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 ~1git push -f <REMOTE_NAME> <BRANCH_NAME>