Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Windows Tipps & SecurityBeyond the Build – September 2026(22.09.2026 um 00:36 Uhr)
Videos & KonferenzenGoogle for Developers: Understand the Gemma 4 model family(22.09.2026 um 01:00 Uhr)
Unix & Linux ServerSecurity: Zwei Probleme in gstreamer1-plugins-base (Red Hat)(21.09.2026 um 23:23 Uhr)
Unix & Linux ServerSecurity: Pufferüberlauf in corosync (Red Hat)(22.09.2026 um 00:49 Uhr)
Sichere ProgrammierungGitHub Enterprise adds credential inventory exports(21.09.2026 um 23:13 Uhr)
Sichere ProgrammierungYour First Factory: GtkListView and the Bind/Unbind Rhythm(22.09.2026 um 01:00 Uhr)
Windows Tipps & SecurityBeyond the Build – September 2026(22.09.2026 um 00:36 Uhr)
Videos & KonferenzenGoogle for Developers: Understand the Gemma 4 model family(22.09.2026 um 01:00 Uhr)
Unix & Linux ServerSecurity: Zwei Probleme in gstreamer1-plugins-base (Red Hat)(21.09.2026 um 23:23 Uhr)
Unix & Linux ServerSecurity: Pufferüberlauf in corosync (Red Hat)(22.09.2026 um 00:49 Uhr)
Sichere ProgrammierungGitHub Enterprise adds credential inventory exports(21.09.2026 um 23:13 Uhr)
Sichere ProgrammierungYour First Factory: GtkListView and the Bind/Unbind Rhythm(22.09.2026 um 01:00 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How to Use Git: A Simple Tutorial for Beginners

Why should every software engineer learn Git? Every software engineer should learn Git because it is essential for modern software development. Git tracks and manages code changes, allows multiple developers to collaborate without…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Why should every software engineer learn Git?



Every software engineer should learn Git because it is essential for modern software development. Git tracks and manages code changes, allows multiple developers to collaborate without conflicts, and serves as a backup for the code.



For open-source contributions, Git is essential as many projects use it for version control. Proficiency in Git is often required for software engineering jobs, making it important for career growth.









Setting up Git



Before learning how to use Git, you should make sure that you have Git on your machine. To verify that you have Git installed, type the following command at your command line:




git --version






If this command returns the version of Git on your machine, it means you have Git installed. The output should look like this:





However, if nothing is returned or you get an output like this:





That means you have to install Git on your system. Don't worry, installing Git is easy, and I will show you how to do it whether you are using Linux, Windows, or Mac.






Git Installation






On Linux



Installing Git in Linux is easy all you have to do is to run the following commands.



If you are using a Debian-based distribution like Ubuntu, First, update your local package index:




sudo apt update






then type this command to install Git:




sudo apt install git






But if you’re on Red Hat-based Distributions (e.g., Red Hat Enterprise Linux, CentOS, Fedora), you can use yum:




sudo yum install git






Or you can use dnf:




sudo dnf install git









On Windows



First, navigate to the latest Git for Windows installer and download the most recent version.



Once the installer starts, follow the instructions provided in the Git Setup wizard until the installation is complete.






On Mac



You can follow the instructions provided in this link to install Git on Mac.



Whether you are using Linux, Windows, or Mac, once you've finished installing Git, run git --version to verify that Git is installed.






Configuring Git



Configuring Git is important because it ensures that your commits and interactions with the repository are properly attributed to you and managed according to your preferences.






Setting up username



To set up your username, type this command:




 git config --global user.name "your-name"






Make sure to replace "your-name" with your own username.






Setting up email



Then, set up your email using this command:




git config --global user.email "[email protected]"






Make sure to replace "[email protected]" with your actual email address.






Initializing a Git repository



To initialize a Git repository, first navigate to the directory where you want to create your repository using this command:




cd /path/to/your/project






Then, you can initialize a repository in this directory by running:




git init






This command creates a new subdirectory named .git in your project directory, which contains all the necessary metadata for the repository.



Congrats, you have initialized your first Git repository! 🥳









Basic Git Commands



After you have initialized your Git repository, you need to know the essential Git commands to manage it, and they are:




git status






The git status command checks what files Git will add to your new repository.




git add .






The command git add . stages all the changes in the current directory and its subdirectories for the next commit.



If you want to stage specific file you can use the following command instead:




git add path/to/your/file/example1.txt






Next you will need to commit the files you have just staged and you can do that by running:




git commit -m "write the commit comment here"






Then if you need to see the history of all the files you have committed use the following command:




git log






It will display all your commits with the author and hash.



But if you prefer to show each commit in a single line per commit, add the --oneline option as follows:




git log --oneline






That is it with basic Git commands. Next, we will learn about branches and how to manage them.









Branching and Merging






Understanding branches in Git



In Git, branches are basically references to a certain commit. They are used to develop features, fix bugs, or experiment in isolation from the main codebase.



Git creates a branch named main (or master in older versions) by default. This is the main line of development.






Creating a new branch and switching branches



If you want to create a new branch but stay on the current branch, use:




git branch branch_name






To create a new branch and switch to it:




git checkout -b branch_name






You may easily return to the previous branch by using:




git checkout -









Renaming a branch



To rename the current branch, use:




git branch -m new_branch_name






If you want to rename another branch:




git branch -m branch_you_want_to_rename new_branch_name









Merging branches



If you want to merge the changes you made from a branch called new_branch to the current branch:




git merge new_branch






After initiating a merging, you may want to pause it and restore everything to its pre-merge condition. Use --abort:




git merge --abort









Deleting branches



To delete a branch locally:




git branch -d branch_name








Be aware that the previous command will fail (produce an error) if the branch branch_name has unmerged changes that would be lost.



In that case, if you really want to delete that branch and don't care about losing the changes that have not been merged, you can force delete the branch (and lose any unmerged changes in that branch) by using the -D flag:




git branch -D branch_name












Conclusion



Learning Git is a must for every software engineer. It helps you track code changes, collaborate smoothly with others, and is often a job requirement. With this guide, you now know how to set up Git, use basic commands, and manage branches.



Get comfortable with Git, and you'll see your development skills and career opportunities grow. Happy learning! 😊

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Use Git: A Simple Tutorial for Beginners

Thematisch verwandte Begriffe: Simple, Tutorial, Beginners · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-49449 | Joplin is an open source note-taking and to-do application that organise…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick