0% found this document useful (0 votes)
243 views12 pages

Git Bash Usermanual

Git Bash is a command line interface for Windows environments that provides functionality similar to the Git command line experience on Linux and macOS systems. It includes common shell commands like Bash, utilities like SSH and SCP, and the full set of Git core commands. Git Bash allows users to interact with Git repositories locally and on services like GitHub from the Windows command line. It is useful for cloning repositories, making changes, committing updates, and pushing changes back to remote repositories for collaboration.

Uploaded by

techbird
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
243 views12 pages

Git Bash Usermanual

Git Bash is a command line interface for Windows environments that provides functionality similar to the Git command line experience on Linux and macOS systems. It includes common shell commands like Bash, utilities like SSH and SCP, and the full set of Git core commands. Git Bash allows users to interact with Git repositories locally and on services like GitHub from the Windows command line. It is useful for cloning repositories, making changes, committing updates, and pushing changes back to remote repositories for collaboration.

Uploaded by

techbird
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Git Bash

Table of Content
1. Introduction.................................................................................................................3

1.1 What is git............................................................................................................3

1.2 what is git bash....................................................................................................3

2. Purpose.......................................................................................................................4

2.1 Git Hub................................................................................................................4

2.2 What is Git Hub...................................................................................................4

2.2 Git vs Git Hub......................................................................................................4


3. Installation of Git Bash..............................................................................................5
3.1 Steps...................................................................................................................5
4. Configuration & Running commands on Gitbash............................................................. 8

4.1 Steps...................................................................................................................8
5. Conclusion......................................................................................................................... 11

6. FAQS................................................................................................................................... 12

2
1. Introduction
1.1 What is Database?

1.2 What is Database?

1.3 What is MySQL?


Git Bash is an application for Microsoft Windows environments which provides an emulation
layer for a Git command line experience. Bash is an acronym for Bourne Again Shell. A shell is
a terminal application used to interface with an operating system through written commands.
Bash is a popular default shell on Linux and macOS. Git Bash is a package that installs Bash,
some common bash utilities, and Git on a Windows operating system.
Git Bash is packaged with additional commands that can be found in the /usr/bin directory of the
Git Bash emulation. Git Bash can actually provide a fairly robust shell experience on Windows.
Git Bash comes packaged with the following shell commands which are outside the scope of this
document: Ssh, scp, cat, find.
In addition the previously discussed set of Bash commands, Git Bash includes the full set of Git
core commands discussed throughout this site. Learn more at the corresponding documentation
pages for git clone, git commit, git checkout, git push, and more.

3
2. Purpose
The purpose of Git bash is the command prompt which you would use to interact between github
and your local copy of the code. You can clone a repository from github to your local machine,
make changes, commit them, push them back to github for everyone else to consume. For all
these activities, you need git bash. Git bash is an interface to github but is not limited to github
only. You can use it with any other git hosting as well such as gitlab, bitbucket etc.
git bash is the utility to interact with github..

On Windows you might run commands like ipconfig /all or format G: using cmd.exe. These
commands are actual executable files under C:\Windows\system32, stored as ipconfig.exe and
format.com files. cmd.exe is separate from both and loads and runs them on user's request.
ssh, scp, cat, find are run using bash in exactly the same way. They are usually stored under
/usr/bin rather than in C:\Windows\system32 on *nix systems, because Windows and *nix have
their system file structure organised differently.
In the case of Git Bash for Windows these programs are located in the Git installation folder: C:\
Program Files\Git\usr\bin, which can also be found in the emulated Linux environment under
/usr/bin.
Just like being able to just run cmd.exe on *nix doesn't allow you to do much without the other
system utilities, just being able to run Bash on Windows is not very useful either. This means
that all these extra commands have to be bundled together with Bash to create a usable software
package.
2.1 GitHub is a code hosting platform for version control and collaboration. It lets you and
others work together on projects from anywhere. This tutorial teaches you GitHub essentials like
repositories, branches, commits, and Pull Requests.

4
3. Installation of Git Bash
3.1 Steps
1. First of all go to the website https://gitforwindows.org/

2. Click on download .Once its downloaded click the executable .exe file

5
3. Choose the valid path where you want to install the Git Bash

4. Select the appropriate components and click next

5. You will see the terminal like this once your git bash is installed

6
6. You can use a command on terminal git –version which will let you know the
gitbash version

7
4. Configuration & Running Commands on Git Bash
4.1 Steps:
Once you start running the Git bash you need commands to run
 git init : Create empty Git repo in specified directory. Run with no arguments to initialize
the current directory as a git repository
 git clone <repo> :Clone repo located at onto local machine. Original repo can be
located on the local machine or on a remote machine via HTTP or SSH

 git config user.name :GIT BRANCHES Define author name to be used for all commits in
current repo. Devs commonly use --global flag to set config options for current user.
 git config user.email :GIT BRANCHES Define author email address to be used for all
commits in current repo. Devs commonly use --global flag to set config options for
current user.

8
 git add: Stage all changes in for the next commit. Replace with a to change a
specific file.

 git commit -m "" :Commit the staged snapshot, but instead of launching a text editor,
use as the commit message.
 git status: List which files are staged, unstaged, and untracked.

 git commit --amend :Replace the last commit with the staged changes and last
commit combined. Use with nothing staged to edit the last commit’s message.

 git rm[file] :This command deletes the file from your working directory and stages the
deletion.

9
 git branch :This command lists all the local branches in the current repository.

 git remote add [variable name] [Remote Server Link] : This command is used to
connect your local repository to the remote server.

 git push [variable name] master : This command sends the committed changes of
master branch to your remote repository.

 git pull [Repository Link] : This command fetches and merges changes on the remote
server to your working directory

10
5. Conclusion

To conclude it can be said that git bash is a command line platform which helps in enabling git
and its elements in your system. There are a bunch of commands which are used in git bash.
With these commands (git init, git add, git commit), you can start tracking your code
development Adding a few additional commands (git push, git clone, git pull) and a GitHub
account, you can share your code online, transfer your changes across machines, and collaborate
in small groups
Git Bash is very easy to use and makes it easy to work on repositories and projects

11
6. FAQS
Question 1: What is a commit message?
The command that is used to write a commit message is “git commit -a”.
Now explain about -a flag by saying -a on the command line instructs git to commit the new
content of all tracked files that have been modified. Also, mention you can use “git add <file>”
before git commit -a if new files need to be committed for the first time.

Question 2. How can you fix a broken commit?


In order to fix any broken commit, use the command “git commit --amend”. When you run this
command, you can fix the broken commit message in the editor.

Question 3. What is a repository in Git?


Repository in Git is a place where Git stores all the files. Git can store the files either on the local
repository or on the remote repository.

Question 4. How can you create a repository in Git?


This is probably the most frequently asked question and the answer to this is really simple.To
create a repository, create a directory for the project if it does not exist, then run the command
“git init”. By running this command .git directory will be created in the project directory.

Question 5. What is ‘bare repository’ in Git?


A “bare” repository in Git contains information about the version control and no working files
(no tree) and it doesn’t contain the special .git sub-directory. Instead, it contains all the contents
of the .git sub-directory directly in the main directory itself, whereas the working directory
consists of
A .git subdirectory with all the Git related revision history of your
repository. A working tree, or checked out copies of your project files.
Question 6. What is a ‘conflict’ in git?
Git can handle on its own most merges by using its automatic merging features. There arises a
conflict when two separate branches have made edits to the same line in a file, or when a file has
been deleted in one branch but edited in the other. Conflicts are most likely to happen when
working in a team environment.

12

You might also like