This is my first project with Git. This project is about basic commands we will need for using Git in our previous projects.
If git is not already installed on your terminal:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install git
Using the graphic interface on the github website, create your first repository.
- Name
- Description
- Public Repo
Next we copy this repository to our terminal with creating a directory with the same name
mdkir <nameoftherepository>
git add
git commit
git push
This commands are used to add our changes in terminal in Git. Another key commands are :
git branch
git checkout
git pull
We used git branch Name to create a branch which is a version of your repository, or in other words, an independent line of development. A repository can contain multiple branches, which means there are multiple versions of the repository.
We used git branch to see in which branch are we in.
We used git checkout new_branch to switch branches.
We used git pull command to fetch and download content from the remote repository and immediately update the local repository to match that content.