Skip to content

othree/git-practice-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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: https://gist.github.com/othree/d9cefd1c4b5bb667d2690330231d5fff

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

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages