You are on page 1of 2

Git commands:

-----------------
git command
git bash
------------------
git bash commands:
--------------------
More like unix env
git --version
which git
ls -la - to list out all dir pwd
-----------------

git config:
----------

there are three config in git


System
Project
User
--------------------------------

to start config:
-------------------

Type Command: git config --global user.name "username"


git config --global user.email "email"

To list the config:


-----------------
git config --list

To change directory: cd ~
.gitconfig file is not visible in gui it can be viewed using commandline

Type Command the command: cat .gitconfig

To set editor: git config --global editor "editplus.exe wl1"


to set color : git config --global color.ui true
===================================================================================
=

Creating a Repo:
---------------------
Create a Dir where we need to save our project files

Type Command: cd path


Type Command: git init

To Commit:
------------
Type Command: git add . --> Means add all files in this directory
Type Command: git commit

Make Changes
Add Changes
Commit Changes

Writing Commit Messages Best Practices:


---------------------------
* Short single line summary
* Followed by blank line
* Each Line less than 72 Char
* Each Line with Present Tense
* Add Bug Number
* Can Develop Shorthand for our organization like {"bugfix:","JIRA ID:"}
* Clear and Descriptive
-------------------------------------------------------------------------------

To See Commit Log:


------------------
Type Command: git log
git log --author="author name"
git log --grep="Init" --> to search all commits starting with
name Init

You might also like