Definitions
Git is a widely used, free, and open-source system designed to handle projects of all sizes. It enables developers to track changes in code for development projects and also fosters collaboration.
Bash is the name of a default shell in MacOs and Linux.
This means that Gitbash is a command-line interface for Microsoft Windows that provides a Unix shell environment for using Git.
Gitbash is locally installed on personal computers.
GitHub is a cloud-based platform where we store, share, and work together with others to write code.
Installation process of Gitbash
- Download the appropriate installer for your operating system from the official Git website. git link
- Click on download and urn the downloaded executable file.
- Follow the prompts in the setup wizard and carry out the necessary configuration to install gitbash.
- Click install to complete the process.
- For verification whether the installation was done correctly, verification of the GitBash version is done on the command prompt using the code below. The correct output specifies the Git version downoaded;
$ git --version
- The final step is to configureyour name and email address
$ git config --global user.name "name"
$ git config --global user.email "email"
Linking of Gitbash and GitHub account
Linking the Git and GitHub accounts is done by adding an SSH key to the GitHub account. This takes git to a higher level as it allows collaboration by team members, accessibility, and automation through a web-based platform
Pushing and Pulling code using git
Git pulling refers to fetching the content from a remote repository and updating the content to match the local repository.
Pulling steps
- Make sure you are on the local branch you want to commit the change.
- Pull the changes by running the command below
git pullThe git pull command is a combination of 2 commands;git fetch- This downloads content from the remote repositorygit merge-It merges the new remote content into a new local merge commit 3.Commit changes to push to repository
Git push is uploading the local repository content to a remote repository
Before pushing, it's necessary to ensure that you have a local repository with committed changes.
Steps to git push
- Push committed changes using the
git push origin maincommand. Origin refers to the default name of the remote repository and main refers to the name of the branch you are pushing to. - Enter credentials when needed.
- Verify the push by refreshing your remote repository on github.
Tracking changes
This is done using 3 core commands.
git status - This command provides a summary of the state of your repository. It includes information on which files are modified, unmodified, untracked, or staged.
git add - Adds changes to your working area to your staging area, which is a picture of changes highlighted for the next commit.
git commit - Records the changes permanently in the local repository. The message displayed is a summary of the changes and the reasons behind them.
Version control
Version control is a system that records changes to a file or set of files over time, allowing recall of specific versions later.
Importance of version control
- A complete long-term history of changes made in the file.
- Branching and merging- This allows individuals in a team to work on different streams of changes, and they can still merge the work afterwards.
- Can easily trace any changes made in the repository.


Top comments (1)
Insightful!!