Skip to content

liu-du/advancegit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

advancegit

Remove files from staging area

git reset 

Revert to previous commit with changes staged

git reset --soft <hash>

Revert to previous commit with changes unstaged

git reset (--mixed) <hash>

Cloneing a remote repo to current directory

git clone <url> .

List tracked files

git ls-tree master -r

Remove (delete) untracked files

git clean -df
- -d: directory, -f: file

Show recent referenced log

git reflog

Checkout a commit that's been deleted from commit history by hard reset

git checkout <hash>

Revert to a commit by creating a new commit

git revert <hash>

Compare to commit

git diff <hash> <hash>

Compare to branch

git diff <branch> <branch (optional)>

Remove initial commit (git reset HEAD~1 won't work)

git update-ref -d HEAD

Add remote origin

git remote add origin <remote_origin>
git push -u origin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published