Terminal & Git Basics Flashcards
How do you push your code on Github?
$ git push origin master
How do you go from current directory to parent folder?
$ cd ..
How do you print the history of the commits of your repository?
$ git log
or
$ git lg
How do you commit your changes on git?
$ git status
$ git add .
$ git commit -m “Your message”
What is git?
Git is a version control system: it helps you track changes in your code and save versions of it. With git you can also share your code with collaborators.
In the terminal, what does . refer to?
To current directory
How do you create a folded in current directory?
$ mkdir folder_name
ex :
$ mkdir restaurants
How do you inspect the detailed changes of the modified files identified with git status?
$ git diff
$ git diff a_specific_file_or_folder
How do you print in the terminal the list of folders and files in current directory?
$ ls
or
$ ll
How do you create a new git repository locally from scratch?
$ mkdir new_project
$ cd new_project
$ git init
In the terminal, what does .. refer to ?
To parent directory, and you can cd to it
ex:
$ cd ..
How do you create a new git repository locally from an existing repo (on Github for instance)?
$ git clone github_ssh_clone_url
How do you create a file in current directory?
$ touch file_name
ex:
$ touch program.rb
What is GitHub?
Github is a service for developers to host code and their versions (under git management). It makes easier code sharing and collaborating. You can find a lot of open source projects on it.
How do you print the path of the current directory in the terminal?
$ pwd