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

Git Commands

This document outlines essential Git commands for version control, including setting up a global identity, cloning repositories, adding files, committing changes, pushing updates, checking out branches, checking status, and pulling changes from the server. Each command is accompanied by an example for clarity. These commands are fundamental for managing code in Git repositories.

Uploaded by

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

Git Commands

This document outlines essential Git commands for version control, including setting up a global identity, cloning repositories, adding files, committing changes, pushing updates, checking out branches, checking status, and pulling changes from the server. Each command is accompanied by an example for clarity. These commands are fundamental for managing code in Git repositories.

Uploaded by

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

Git Commands

1. Set your global identity (applies to all repos on your machine):


git config --global user.name "Abhi Patel"
git config --global user.email "abhi@example.com"
git config --list
(This sets your name and email for commit history.)

2. git clone [link] :- server to locally copy


Ex. git clone https://github.com/AbhiPatel85/example.git

3. git add [file_name] :- add new file


Ex. git add abhi.txt

4. git commit -m "[write any msg]" :- saved made changed


Ex. git commit -m "Create new file"

git commit -m "[write any msg]" abhi.txt :- particular file commit

5. git push :- add update in server

6. git checkout [branch_name] :- go to another branch


Ex. git checkout code

7. git status :- to check the status

8. git pull :- to see the changed made in server on locally

You might also like