GIT COMMANDS

GIT COMMANDS


  1. git diff

Description:

Shows the differences between files in your working directory and the index (staging area).

Command:
git diff

Image description

  1. git log

Description:

Displays the commit history of the current branch with details such as commit ID, author, and date.

Command:
git log

Image description

  1. git clone

Description:

Clones an existing remote Git repository into a local directory.
git clone https://github.com/username/repository.git

Command:
git clone https://github.com/M-Sugumarm/ml.git

Image description

Image description

  1. git fork

Description:

Creates a personal copy of someone else’s repository into your GitHub account.

  1. git pull

Description:

Fetches and integrates changes from the remote repository into the current branch.

Command:
git pull origin main

Image description

  1. git push

Description:

Sends committed changes to a remote repository like GitHub.

Command:
git push origin main

Image description

  1. git blame

Description:

Shows who last modified each line of a file and when.

Command:
git blame filename

Image description

Image description

  1. git merge conflict

Description:

Occurs when changes from different branches conflict during a merge.

Command to simulate:

Make conflicting changes in two branches
git merge feature-branch

Image description

  1. git branch

Description:

Lists existing branches or creates a new one.

Command:
git branch

To create a new branch
git branch new-branch

Image description

  1. git ignore

Description:

Used to exclude files and directories from version control by specifying them in a .gitignore file.

Command:

Create or edit .gitignore file and add the filenames or patterns to exclude.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *