0% found this document useful (0 votes)
39 views1 page

Git Commands

The document provides instructions for basic Git commands: 1) It shows how to set global Git configurations and save files using Vi editor. 2) Commands are demonstrated for adding, committing, checking status and viewing logs. 3) Additional commands shown include adding text to a file, creating a new untracked file, viewing file contents, adding and committing all modified files, and checking out files to revert changes.

Uploaded by

Hari Nair
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)
39 views1 page

Git Commands

The document provides instructions for basic Git commands: 1) It shows how to set global Git configurations and save files using Vi editor. 2) Commands are demonstrated for adding, committing, checking status and viewing logs. 3) Additional commands shown include adding text to a file, creating a new untracked file, viewing file contents, adding and committing all modified files, and checking out files to revert changes.

Uploaded by

Hari Nair
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/ 1

git config --global

Vi editor save

Press I

: wq

<Enter>

Git add inext.txt

git commit –m ‘first commit by me’ // Comment is mandatory in git

git status

git log

echo some text>> index.txt

touch newFile.txt

cat index.txt // to view the content of the file

git add . // . is used for all

git –a –m ‘Monday commit’ // to add and committing modified files only not for untracked file

or

git –am ‘ Monday commit’

git –oneline //shows in the form of /n

git branch

git co /// commit config

git checkout --index.txt file1.txt // to revert the current changes

git reset HEAD file1.txt index.txt

You might also like