Over the past two days, we have been learning how to use git and Github.
Definition and Introduction to Git
Git is a version control tool that is used to track changes made in a file.
It is mostly used for collaboration between programmers.
Git has a workflow made up of various stages;
- Working Directory
- Staging
- Commit
- Push
1. Working Directory
This is where the file resides in the folder in your actual device. It is where you create, open, edit and delete files.
There are two types of files in the working directory;
- Untracked files; these are files that have not been added to the git tracking system.
- Tracked files; these are files that are in an initialized git repository. You initialize a repository by running the git init command
2. Staging Area
This is like a preview area for conducting reviews and organizing changes before adding them to your project history. It tells git what should be included in your next commit.
3. Commit
These are messages containing a brief description of the changes you made to a file.
The command for commit is git commit -m "Your message"
4. Push
This entails sending the files to a repository in Github.
Top comments (0)