If you're a new developer and just started with your coding journey you should know about Git and Github. In this article we will learn basic Git commands you should know as a developer. Git was created by Linus Torvalds who created the Linux Kernel.
Git is a Version Control System. With Git, you can track changes in your files, and it simplifies working on files with multiple contributors.On the other hand, Github is a web based Git repository and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code.
Initialize the git
Go to the project you want to initialize the git and enter the command.
git init
Git status
You can enter this command to know about the git status.
git status
Git add
Now you want to stage the changes you made in your file. Use dot(.) to select all files
git add . (for all)
git add index.html
Git commit
Finally, commit your changes using this command
git commit -m "Initial commit"
Adding a remote repository
Use this command to add your project from your local machine to GitHub
git remote add origin https://github.com/YourURL
Pushing your code to the remote repository
Finally, push your changes from your local to github using this push command
git push -u origin master
Thank you for reading!
#CSS #Git #Github #LCO #IWriteCode #iNeuron #FullStackJavaScriptWebDeveloperBootcamp