GIT
Vocabulary: GIT vs GITHUB
What is Git
?
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. (Wikipedia)
What is GitHub
, Gitlab
etc ?
GitHub, GitLab, Bitbucket, etc. are web-based hosting services for version control using Git. They provide a web-based graphical interface and access control, as well as several collaboration features such as wikis and basic task management tools.
GIT on Visual Studio Code
- Go to the
Source Control
tab
Translated in commands :
# git init# git remote add origin URL_HEREgit add template/style.css # add the file to the staging areagit commit -m "[feature] add css" # commit the changesgit push # push the changes to the remote repository
- for the first push :
git push -u origin main
Some GIT commands :
git init # create a new repositorygit clone <url> # clone a repositorygit add <file> # add a file to the staging areagit commit -m "<message>" # commit the changesgit push # push the changes to the remote repositorygit pull # pull the changes from the remote repositorygit status # check the status of the repositorygit log # view the commit historygit branch # list all branchesgit switch <branch> # switch to a branchgit reset --soft HEAD~1 # remove the last commit