libby
libby
Reputation Top 1%
libby kent
9 Snippets
Published
1 Channel
Created
1 Channel
Following
2890 points
Reputation
Junior Code Generator
Serious Code Generator
Junior Publisher
Serious Publisher
Junior Topic Creator
Junior Topic Hub
Serious Topic Hub
Senior Topic Hub
Junior Trend Maker
Serious Trend Maker
Junior Team Manager
Junior Popular Coder
Serious Popular Coder
Junior Autobiographer
Serious Autobiographer
Senior Autobiographer
Master Autobiographer
Serious Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by libby

public by libby  1789  1  5  -1

Remove commits, but keep local changes.

Removes the last commit, but will preserve the local changes.
Git
git reset HEAD~1
;

public by libby  2434  1  5  0

Remove local commits and local changes

Remove the last commit and the local changes associated with that commit. HEAD~1 removes the last commit and the associated local changes, HEAD~2 removes the last 2 commits and the associated local changes, etc.
Git
git reset --hard HEAD~1 
;

public by libby  2433  0  5  0

Remove from index

Remove files from index
Git
git reset
;

public by libby  244810  1  5  0

Add remote repo

The remote is an external location for the repository, i.e. where it lives on git hub. Generally, a repository has one remote, but it is not limited to one remote.
Git
git remote add origin https://github.com/repoowner/reponame.git
;

public by libby  2254  1  5  0

Create a branch

Create a new branch
Git
git checkout -b newBranchName
;