- Click on the "Clone or download" button
- Copy the URL. Chose "Clone with HTTPS" if you haven't setup your SSH
- Run
git clone https://github.com/USERNAME/REPOSITORY_NAME.git
in your terminal
- After you cloning a repository, usually it make a new folder within you current directory named the same as REPOSITORY_NAME
- Navigate into it by running
cd REPOSITORY_NAME
- If you want to open your current directory on text editor for example VSCode, run
code .
to open VSCode
- Try to edit a file or create a new file
- Check your changes with
git status
. You will see file name(s) with red color - Or with
git diff
if you want to see the changes detail. You can quit by pressingq
git add file_1.txt path/to/file_2.txt
. With this you are adding two files which arefile_1.txt
andfile_2.txt
(placed insidepath/to/
directory) at once- You also can run
git add .
to add all the changed files
- Run
git status
again to make sure that you have any files with green color (green color means they're added into staging area) - Run
git commit -m "BRIEFLY TYPE WHAT CHANGES YOU'VE MADE HERE"
. An informative message would help in the future. - Make sure you get
x files changed, y insertions(+), z deletions(-)
feedback
- Run
git push origin master
.Assuming you are in branchmaster
or forget this sentence if you have no idea what is it - If you get asked for login, login using your github username and password
- Check the repo in your github profile to make sure you did this correctly. Maybe you'll get a little happiness seeing your commit message existed there :)
Done this course to deepen your git skill https://egghead.io/courses/practical-git-for-everyday-professional-use