Ever since I have started using Github more, I have started using few terminal commands regularly.
If you are a beginner, these terminal commands might be useful to you too.
Browsing through files
When you want to work with a certain directory, you need to find it with your terminal. This means that you need to know a location of that specific file.
- Type cd (=change directory) to terminal.
- Write the path to the directory after cd
How to make sure that you are in the right folder?
Easy, type ls to terminal and you see a list of the files in the current directory.
What if I accidentally went to a wrong directory?
Type cd to change directory. Then after cd type ../ if you want to go one step backwards in your path. Type cd ../../ if you want to go two steps backward, cd ../../../ goest three steps and so on.
These are usually my steps when I push changes to Github. I’m working on my project alone so I push straight to master. This page helped me to understand the basics of git: git- the simple quide
- git status = Ask for a status of the current directory. You get a list of files that have been changed.
- git add filename.html = Add a file that you want to add to be committed.
- git add . = Add all files that have been changes.
- git commit -m “my message here” = Commit changes -m stand for a message that is linked to your commit
- git push origin master = push changes to master and see your changes in Github