Understanding the Git Workflow:Working directory,staging ,commit and push.
What is Git and Github This is a version control system or tool used to track changes by developers. When one installs git it comes with an inbuilt terminal called gitbash Github is a cloud based platform for storing git repositories online. Just sign up for free,verify via email and your account is created. git and github are connected using a SSH KEY. How Git works. We start by installing git on my Pc, after installation check if git is installed by opening a terminal eg powershell on windows and run git --version Stages Git/Github is broken into four simple stages: working directory is where we write code and amend and delete files. Here changes are made but cannot be tracked unless they are instructed to commit. staging phase is an area where files are modified. commit phase is where git takes everything from the staging area and sends it to our local repository. push phase is where the saved commits are sent to a remote repository like GitHub. Creating folders and files on git bash First identify where we want the folder to be located ls is used to list mkdir "name of the folder" (means make directory) cd " name of the folder" (change directory) Readme texts README.md end with .md since they are written using markdown language.Can use echo,touch or nano commands to write a readme file. If i want to know the contents of my readme file we use: cat README.md git config-this is basically telling it my identity git config --user.name"user" git config --user.email "useremail" git init-this command is used to create or initialize a repository in main/master. git init main git status-shows the repository status. This command shows changes and what is happening in git git status git add-stages changes made git add . this means stage all or one can specify what to be added e.g i want to add only a javascript folder git add script.js git commit-commits records that have been staged in the local git repository.Its like getting a snapshot or memory of the file. git commit -