Basic Git and Terminal Commands
March 25, 2020
note The $
should not be typed, it just lets you know that the command should be typed in the Terminal
Basic Git Commands
Command | Description |
---|---|
$ git init |
initialize a git repo |
$ git add . |
add files to staging |
$ git commit -m 'message' |
add a git commit |
$ git push origin master |
push to github remote master branch |
$ git clone [PASTE_REPO_URL] |
push to github remote master branch |
$ git pull origin master |
pull down from your remote GitHub repo |
$ git remote -v |
show all remote repos |
Basic Terminal Commands
Command | Description |
---|---|
$ pwd |
present working directory (you are here) |
$ history |
show all past history of Terminal commands (in Terminal session) |
$ mkdir FOLDER_NAME |
create a folder |
$ touch FILE_NAME |
create a file |
$ cd FOLDER_NAME |
change into a directory |
$ cd ../ |
go up one directory |
$ mv FOLDER_ONE FOLDER_TWO |
rename a folder |