đ Posted on 2021-4-18
So, what is Git in a nutshell? This is an important section to absorb, because if you understand what Git is and the fundamentals of how it works, then using Git effectively will probably be much easier for you. A free and open source version control system.
GIT is the tool that tracks the changes in your code over time whereas GITHUB is a website to host your repositories online. Being online it makes easy to work in groups with other people and organize your projects into a portfolio for you to show potential employers.
Here are some of the GIT commands we are going to cover in this section of the book that you are going to type in Terminal (MAC) or command line (WINDOWS) in your computer. They are:
clone:Â Bring a repository that is hosted somewhere like Github into a folder on your local machine. For example if there is a repository that is not on your local machine but itâs on Github and you want to bring it down on your local machine, So you can use it locally.
add:Â Track your files and change in Git. When you have updated files or created or deleted files in folder youâre gonna want to tell Git that you made changes and that you would like to get track of those changes so you use the add command.
commit:Â Save your files in Git As I said earlier that Git is there for you to save the changes of your code so you do that through a commit and we call it committing your changes.
push:Â Upload Git commits to a remote repository, like Github Once you have made changes locally on your computer and you are ready to put them in Git. You tell Git to track them through the add command you save your files to get through the commit command and then you upload your files to a place like Github or another what we call remote repository or Github alternative like Bitbucket, Gitlab and thereâs many of them you do this through push command.
pull:Â Download changes from remote repo to your local machine, the opposite of push. When there are changes to you code on Github and you want to bring those to your local machine then you use the pull command. You pull down the changes from the remote repository.
$ cd folder-path
$ git init
$ git add .
$ git commit -m âinitial commitâ
$ git remote add origin {paste the copied URL from clipboard}
$ git push -u origin master
In this post you discovered Git And GitHub for beginners. You learned that:
Do you have any questions about GIT and GitHub or this post? Leave a comment and ask your question and I will do my best to answer it.