Git Basic Command

Setup & Init

Initialize an existing directory as a Git repository

$ git init
Initialized empty Git repository in ~/Desktop/git-directory/.git/

retrieve an entire repository from a hosted location via URL

$ git clone [url]

Inspect git

show the commit history for the currently active branch & show any object in Git.

$ git log
$ git show
Merge: 5dfd7fc d53a204
Author: jayjo
Date:   Sun Nov 8 11:40:20 2020 +0900

    Merge branch 'master' of 

Add all file contents to the index and Record changes to the repository

$ git add . && git commit -m "description"

Remove a git commit that has not been pushed

$ git reset HEAD~1

Leave a Reply

Your email address will not be published.