https://github.com/othree/git-practice-base
https://github.com/othree/git-practice-base
git
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/othree/git-practice-base
- Owner: othree
- Created: 2017-03-07T08:46:12.000Z (over 9 years ago)
- Default Branch: readme
- Last Pushed: 2017-03-23T07:00:13.000Z (over 9 years ago)
- Last Synced: 2025-10-09T01:16:19.830Z (9 months ago)
- Topics: git
- Language: TeX
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-practice-base
A git repositorey to practice some git controls.
## Before Start
Fork this repo to your account.
## Basic
Clone this repo:
git clone https://github.com/othree/git-practice-base.git
Replace `othree` with your account id.
Edit `README.md`. Then commit.
### Edit commit message
git commit --amend
or by `reset`
git reset --soft HEAD^
zsh:
git reset --soft HEAD\^
Git reset can used to edit entire commit.
## Merge
Fecth and track all branches:
Or `checkout` before merge/rebase...
git co for-fast-forward
Checkout `master`
git co master
Fast forward merge:
git merge for-fast-forward
None fast forward merge:
git merge for-no-fast-forward --no-ff
## Rebase
Checkout `master`
git co master
Rebase without any conflict:
git rebase for-rebase
Rebase and will have conflict:
git rebase for-rebase-conflict
Solve conflicts then:
git add src/es2015-script.js
git rebase --continue
Try `rebase continue --skip`:
git rebase for-rebase-conflict-skip
Saw conflicts, and skip changes(Use HEAD reversion, a.k.a master):
git rebase --skip
Undo a rebase
git reset --hard ORIG_HEAD
## Remove Sensitive Data