Git
Veröffentlicht am: 04. März 2020
Lesedauer: 1 Min.
What is Git?
Git is a revision control system. It enables you to keep track of changes made to your source code (the code of your website). It basically means, that you can have different versions of the code of your website. For example, let's say you have a website and you want to change the layout of the frontpage. Without Git you would probably just make the changes and save the file / files and upload your new code. Some might also create a copy of the code and put the changes in a different folder and keep the old code base. With Git you can still make those changes, but you can also see where and when you made changes to your code and you don't need to make any copies, because everything is saved in a repository. You can even undo changes and revert to your old code base without making copies or saving copies.
Why you should use Git
A better overview of your Code and changes made to your Code.
Overview of Git Commands
Initialize a Git repository git -init
Check Status git status
Add all files to the staging area git add .
Commit changes to repository git commit -m "here you can enter a message"
git init
create repository manually in GitHub
$ git remote add origin https://github.com/user/repo.git
Set a new remote
$ git remote -v
Verify new remote
git push -u origin master
git status
git add . -> adds all files to staging area
git status
git push origin master
git log --oneline git revert id
git diff -> show changes to file (difference) git log -> show commit history
Articles in related Categories
Google Tag Manager
Axios
Redux
Express
Node.js
Git
HTML
GraphQL
Javascript
styled-components
Material UI
CSS
Gatsby
React