DEV Community

Cover image for Baby coders. Git add/commit/push and create files using terminal.
Jazlin Bella Yu
Jazlin Bella Yu

Posted on • Edited on

Baby coders. Git add/commit/push and create files using terminal.

Here we are going to focus on git add/commit/push as well as a simple action to create a file with the terminal.

when changing files on a cloned repository we want to always follow through with adding the changes through git with $git add . , then committing them with $git commit -m "description of changes", and finally push the changes right to your forked repository on github with $git push

example:

$git add .
$git commit -m "add README.md"
$git push
Enter fullscreen mode Exit fullscreen mode

If the steps are followed correctly you should see the changes reflected on your forked over repository on github.

Image description

Now lets move on to another simple but important to remember action.
Lets create a file in your repository using $touch.
When creating a file it could be simplest to just use Vscode to right click and create file. Yet its super important to know the roots and basics so if you are put in a situation where you cant use vscode you will still be able to make a file in seconds using our lovely terminal.
Lets get straight to it!

Example:

$touch README.md
Enter fullscreen mode Exit fullscreen mode

Boom its as simple as that!!!
Now lets break this down.
First we use the command touch "touch is used to create files", next we name the file being "README". We next need to define that file type so this type will be ".md"
Now we have our new file created! woooo!!! GJ!

Image description

Top comments (0)