Git Commands Tutorial For Beginners
This tutorial is about to learn some basic git Version control system commands via the command line, with some example.
Requirements:
Introduction: What is Git?
Git is a version control system:
A set of software tools for:
● Memorize and find different versions of a project.
● Facilitate collaborative work.
Originally developed by Linus Torvalds to facilitate the development of the Linux kernel.
● Free/open-source software.
● Available on all platforms.
Tool configuration:
Configure user information for all local repositories
Defines the name you want to associate with all your committed operations
git config --global user.name "[name]"
Defines the email you want to associate with all your commit operations
$ git config --global user.email "[email address]"
Enable colorization of the command line output
$ git config --global color.ui auto
Start a Git repository:
Create a local repository from the specified name
$ git init [project-name]
Clone an existing repository:
$ git clone ssh: //elgarnaoui@serveur/git/projet.git
$ git clone https://repositoryurl/projet.git
The “clone” command creates a copy of an existing Git repository. You clone a repository with git clone [URL]. We have both the clone by the ssh URL which requests a public key and by HTTPS which asks for authentication each time.
Exclude from version tracking:
Exclude temporary files and paths
A text file named .gitignore helps prevent accidental version tracking for files and paths that match specified patterns.
* .log
build /
temp- *
List all files excluded from versioning in this project
$ git ls-files --others --ignored --exclude-standard
Save changes to a repository:
There are four states of a Git file:
- Untracked: file not (owned) or no longer managed by Git;
- Unmodified: file safely saved in its version current in the repository database;
- Modified: a file that has undergone modifications since the last time that it has been submitted;
- Indexed: same for modified, except that it will be taken instantaneously in its current version of the next commit.

a- Check the status of files:
$ git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
.springBeans
SpringTuto/
pom.xml
src/
nothing added to commit but untracked files present (use "git add" to track)
Untracked files: files not tracked because it is not indexed.
b – Index the addition or changes of a file before submitting (commit) changes:
$ git add .
c- Validate the modifications:
$ git commit –m "My first commit"
The “commit” command is made to validate those that have been indexed with “git add”. Index pad no validation.
After the –m option is followed by a user comment, describing what it has accomplished and it adds the file to the Git directory/repository (local) but not yet on the repository distant.
d- View the history of validations:
$ git log
By default, git log lists in reverse chronological order the commits made. This means that the most recent ones appear first.
e- Redo commits:
Correct errors and manage the history of corrections.
Rollback all commits after [commit], keeping changes locally
$ git reset [commit]
Removes all history and changes made after the specified commit
$ git reset --hard [commit]
f- Push your work to a remote repository:
$ git push origin master
The “push” command is used to send all the “commits” performed in the Git/ repository (HEAD) directory of copy from the local repository to remote repository.
g- Recover and shoot from remote repositories:
$ git pull
The “pull” command allows you to update your repository local of the last validations (modifications of files). It makes the order before indexing changes.
Git Branch:
To make a branch means to deviate from the mainline of development and to continue working without worrying about this main line.
The default branch in Git when you create a repository is called master, and it points to the last of the commits to be performed.
Why use branches?
- Be able to embark on ambitious developments by having always the ability to revert to a stable version that we can continue to maintain independently.
- Being able to test different implementations of the same functionality independently
1- Create a new branch named “feature_x“:
$ git branch feature_x
2- Switch to an existing branch:
$ git checkout feature_x
This moves (HEAD) the pointer to the feature_x branch. All commits at this time are done on the current branch.

3- Return to the main branch:
$ git checkout master
4- Delete the branch:
$ git branch –d feature_x
5- Incorporation of the modifications of a branch in the current branch (HEAD) by merge:
$ git merge
Merge another branch with the active branch (for example Master). It is possible that there are conflicts to be resolved during a merge.
Merger conflicts:
When you change the same part of the same file in the two branches you want to merge, Git does will not be able to perform the merge properly:
- No merge commits are created, and the process is put on pause.
- You must then settle these conflicts manually by editing the files indicated by git:
- Make
git statuswhich gives the files that could not be merged (listed as “unmerged”). - Mark conflicts as resolved by placing the order git add or git commit -a
- After resolving all conflicts, we can submit changes as a merge commit object with
git commit –m "My first commit"orgit pushand terminate the merger process.
- Make
Thank you for reading our post, To support us share it with your friends on social media. And if you have any question, let me know in the comment below 🙂

Equili
phontechm
폰테크
сглобяеми къщи
top marijuana clones New York
togel dolly4d
Hanging jackets or backpacks becomes smoother with a reliable hook. https://thepruite.com/ hooks never wobble under weight. I appreciate how simple it makes everyday organization. Each corner feels a little sharper and calmer because of them.
???????????????????!https://lantu-jp.com/??????????????????????????????????????????????????????????????????????????????????????????????????????LANTU????????????????????
“???????????????????????????! https://kandao-jp.com/
?KanDao?????????????????????????????????????????360°????????????????????AI???????????????????????????KanDao?????????????”
?????????????????????????!https://xgaghb-jp.com/??????????????????????????????????????MP3??????????????????????????????????????????????????????????XGAGHB????????????????????????
Hanging jackets or backpacks becomes smoother with a reliable hook. https://thepruite.com/ hooks never wobble under weight. I appreciate how simple it makes everyday organization. Each corner feels a little sharper and calmer because of them.
Willkommen beihttps://das-accakappa.de/ Virginia Rose. Die Kollektion umfasst Eau de Cologne, die leicht auf Haut und Kleidung liegt. Der Duft offnet mit floralen Noten, weich und klar, bleibt subtil uber Stunden. Acca Kappa Virginia Rose ist in 100 ml Flakons erhaltlich, einfach in der Anwendung, angenehm zu tragen und fur Damen gedacht, die florale Eleganz mogen.
Hallo! https://das-sparkfun.de/ zeigt, wie MicroPython- und RedBoard-Kits Technik greifbar machen. Sensoren messen Licht, Abstand und Bewegung, OLED-Displays geben Daten aus, Motoren und Servos setzen Signale in Bewegung um. Tasten, Potentiometer und Kabel erleichtern Experimente, alles passt auf das Steckboard, ohne Loten. Fur Maker, Schuler oder Hobbyisten sind die Kits ubersichtlich aufgebaut, Schritt-fur-Schritt-Projekte fuhren durch verschiedene Schaltungen und zeigen direkt, wie Sensoren, Motoren und Displays zusammenarbeiten. Zubehor wie USB-C-Kabel oder Qwiic-Module erweitern Moglichkeiten weiter.
Hallo, Freunde von Ordnung und Ideen! https://banborba.de/ steht fur Dinge, die funktionieren – stark, durchdacht, zuverlassig. Von Edelstahl-Tischen und Gasherden uber Wasserhahne, Steamer und Weinstander bis hin zu Dartboards oder Baumkletter-Sets. Hier zahlt jedes Detail, jedes Material, jede Schraube. Es ist das kleine Gluck, wenn alles seinen Platz hat und alles halt, was es verspricht. banborba – wo Alltag nicht kompliziert, sondern einfach gut gemacht ist.
Hallo an alle, die den Duft junger Blatter lieben. Mit https://das-viparspectra.de/ erwacht jedes Pflanzchen zum Leben, sanft gefuhrt vom prazisen Spiel aus Licht und Schatten. Ob winziger Spross oder kraftige Blute – die Lampen schaffen ein Klima, das nahrt, starkt und wachsen lasst. Technik und Natur tanzen hier in leuchtender Harmonie.
Hallo an alle, die gerne Neues entdecken. Bei https://sumeber.de/ treffen Bewegung und Alltag aufeinander – hier rollen Kinder auf leuchtenden Inlinern durch den Park, gleiten Jugendliche auf Waveboards durch die Stra?en, wahrend daheim Wasserhahne glanzen, Tische funkeln und Schirme Regen in Kunst verwandeln. Jedes Stuck bringt ein Stuck Freude in den Tag – leicht, clever, lebendig.
Hallo an alle, die Taschen lieben. Bei https://bestou.de/ glitzert jede Form ein bisschen anders – mal mit funkelnder Geometrie, mal mit ruhiger Lederoptik. Gro?e Shopper, zarte Clutches, wandelbare Umhangetaschen – sie alle halten kleine Welten zusammen. Fur Arbeit, Spaziergang oder Abendlicht, jede begleitet den Tag mit Glanz und Gefuhl.
“???????????????????????????!https://michealwu-jp.com/
?MICHEALWU?????????????????????????????????????????????????????????????????????????????????????????????????????MICHEALWU?????????????”
Hey everyone! If you’re planning an outdoor adventure, check out https://mycamelcrown.com/. You’ll find comfy, durable gear like hiking shoes, jackets, and even camping tents. They blend style with functionality, so you can stay comfy and look good while exploring. Definitely worth a look if you love the outdoors!
Hey! Hier geht es um mehr als nur Farbe – https://das-bondex.de/ schutzt, nahrt und lasst Holz atmen. Ob wetterfeste Lasuren, seidig glanzende Lacke oder tief pflegende Ole, jede Formel ist gemacht, um Regen, Sonne und Zeit zu trotzen. Fur Zaune, Terrassen, Gartenhauser, fur alles, was drau?en steht und Charakter hat. Bondex halt, was Natur verspricht – Bestandigkeit mit Herz und Hand.
Hallo bei https://das-bosca.de/. Die Auswahl reicht von elektrischen Fondues uber Raclette-Sets bis zu Pizza- und Schneidewerkzeugen. Fondue- und Raclette-Topfe sitzen stabil auf dem Tisch, die Messer schneiden Kase und Fleisch prazise, Boards tragen Snacks oder Tapas. Grillplatten, Pizzaheber und Pizzasteine erweitern die Moglichkeiten, alles aus robustem Holz und Edelstahl, einfach zu handhaben, direkt auf dem Tisch einsetzbar. Jede Komponente fuhlt sich vertraut an und erleichtert das gemeinsame Essen.
Lock and Love creates jewelry inspired by love and connection, perfect for special moments. Their designs include locks, keys, and heart motifs to symbolize affection. Discover their collection at https://thelockandlove.com.
Aablexema’s accessories and fashion items stand out for their originality and quality. Perfect for those who want to add personality to their look. Check out their offerings at https://theaablexema.com.
Moonet’s collection focuses on casual pieces with clean lines and comfortable fabrics. Ideal for those who appreciate simple, versatile style. Discover the range at https://themoonet.com.
Hallo an alle, die den Geruch von Farbe und den Klang klickender Teile lieben. https://das-aoshima.de/ erschafft kleine Wunder aus Plastik – vom kultigen Knight Rider bis zum legendaren DeLorean. Turen offnen sich, Lichter glimmen, Formen erwachen. Jedes Modell erzahlt Geschichten von Geschwindigkeit, Kino und Kindheit, eingefangen im Ma?stab 1:24.