add git-operations-in-the-command-line
All checks were successful
Deploy triz-docs to civital server / build-and-deploy (push) Successful in 1h8m30s

This commit is contained in:
Othmane Ataallah 2026-04-29 09:46:33 +01:00
parent d8c9c815f4
commit 6010b96146
12 changed files with 109 additions and 0 deletions

View File

@ -0,0 +1,8 @@
{
"label": "Command-Line",
"position": 3,
"link": {
"type": "generated-index",
"description": "Guide for performing Git operations using the command-line interface."
}
}

View File

@ -0,0 +1,48 @@
---
sidebar_position: 2
title: "Add & Commit Changes"
---
# Add & Commit Changes
---
# Add Changes
## Objective
Select modified files and place them into the staging area before committing.
## Steps
1. Modify one or more files in the project.
2. In the terminal, check the status of the repository: `git status`
![Git Status](img/2.png)
3. Add files to the staging area: `git add .`
![Git Add](img/3.png)
4. Verify that files are staged: `git status`
![Git Status Staged](img/4.png)
---
# Commit Changes
## Objective
Save local changes to the local Git repository.
## Steps
1. Ensure files are staged.
2. Enter the commit command with a message: `git commit -m "Your commit message"`
![Git Commit](img/5.png)
3. Verify the commit: `git log --oneline`
![Git Log](img/6.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -0,0 +1,16 @@
---
sidebar_position: 1
title: "Prerequisites"
---
# Prerequisites
---
## Steps
1. Install Git on the system.
2. Open a terminal or command prompt.
3. Navigate to the project directory that is already connected to a Git repository.
![Terminal Window](img/1.png)

View File

@ -0,0 +1,37 @@
---
sidebar_position: 3
title: "Push & Pull Changes"
---
# Push & Pull Changes
---
# Push Changes
## Objective
Send committed changes from the local repository to the remote repository.
## Steps
1. Ensure at least one commit exists locally.
2. Execute the push command: `git push`
![Git Push](img/7.png)
---
# Pull Changes
## Objective
Retrieve updates from the remote repository and merge them into the local repository.
## Steps
1. Execute the pull command: `git pull`
![Git Pull](img/8.png)
2. Review the output for updates or merge results.