Git command examples

Git is crucial for version control, enabling teams to collaborate, track changes, and manage code reliably in software development projects

Here are useful git command examples! 😎👇

#coding #programming #softwaredeveloper #github

Find high-res pdf books with all my DevOps related infographics at https://study-notes.org

2025/8/12 Edited to

... Read moreHey everyone! As someone who’s spent a lot of time wrestling with version control, I know how crucial Git is. I often wished I had a straightforward list of commands when I was starting out, and even now, a quick reference is invaluable. So, I wanted to share some of the essential Git commands that have really made a difference in my workflow. Think of this as your personal cheat sheet for navigating most common scenarios! Let's kick things off with basic operations. These are the commands you'll use almost daily. To start a new repository, git init is your best friend. If you're joining an existing project, git clone [repository-url] will get you set up in no time. Checking the status of your working directory with git status is a habit I’ve developed – it tells you exactly what’s going on. Next up, staging and committing changes. This is the heart of Git. After making edits, you use git add [file-name] or git add . to stage your changes. This tells Git, "Hey, I want to include these modifications in my next snapshot." Once staged, git commit -m "Your descriptive message" saves those changes permanently to your repository's history. I always try to write clear, concise commit messages; it makes looking back so much easier! Viewing changes is another area where Git shines. To see the differences between your working directory and the staging area, git diff is incredibly useful. If you want to see the changes between your staging area and the last commit, use git diff --staged. And of course, git log is indispensable for browsing the commit history. I often use git log --oneline --graph --all for a more visual and condensed view of the branches. When it comes to team collaboration, managing branches is key. git branch [branch-name] creates a new branch, and git checkout [branch-name] switches to it. I highly recommend working on separate branches for new features or bug fixes to keep your main codebase clean. Once your work on a branch is complete, git merge [branch-name] integrates those changes back into another branch (like your main development branch). I've found git branch -d [branch-name] useful for cleaning up merged branches afterwards. Managing remote repositories is how we share our code. git remote add origin [remote-url] links your local repository to a remote one (often GitHub or GitLab). To send your local commits to the remote repository, use git push origin [branch-name]. And to fetch the latest changes from the remote, git pull origin [branch-name] is what you need. I always pull before I start working to avoid merge conflicts later on. Finally, sometimes we make mistakes, and Git is forgiving! Undoing changes is possible. git reset --hard HEAD will discard all local changes and revert to the last commit – use with caution! For specific files, git checkout -- [file-name] can revert changes. If you’ve committed something and want to undo it, git revert [commit-hash] creates a new commit that undoes the changes of a previous one, which is safer for shared history. For more advanced scenarios, git rebase can be used to rewrite commit history, but that's a topic for another day! Lastly, git tag is great for marking significant points in your project history, such as release versions. I hope this expanded list of commands gives you a clearer picture of how powerful Git can be. It’s definitely helped me streamline my development process, and I believe understanding these essentials will do the same for you!

Related posts

College Resume Tips and Examples 📝💻✍🏼🎓
Creating a college resume is essential for applying to colleges, internships, scholarships, and jobs. A strong resume highlights your achievements,skills, and experiences in a clear and organized manner. Here’s a step-by-step guide on how to write an effective college resume: ✍🏼 Start with a Str
Joy 📚

Joy 📚

478 likes

This image displays a comprehensive list of Tcpdump command examples for network traffic analysis on Linux. It covers various functionalities like capturing, filtering by interface, protocol, IP, port, and subnet, saving to files, displaying detailed packet information, and advanced filtering using TCP flags and VLANs.
Tcpdump command examples
Tcpdump is a powerful command-line tool for capturing and analyzing network traffic on Linux. This tool is essential for cybersecurity pros and sysadmins to troubleshoot issues, inspect protocols, and detect suspicious activity Here are useful tcpdump command examples 😎👆 #technology #softwar
Learn Linux with Dan

Learn Linux with Dan

7 likes

A black background image titled "Linux scp Command Examples" lists various scp commands with their functions, including copying files/directories, using custom SSH ports, compression, private keys, rate-limiting, and jump servers. It also features a small circular image with "Created by Dan Nanni study-notes.org".
Scp command examples
The scp command lets you securely copy files between hosts over an SSH connection. Some of you might think scp is deprecated but in fact what’s deprecated is the scp protocol, not the command itself. The command now uses a more secure sftp protocol by default Here are some of useful scp com
Learn Linux with Dan

Learn Linux with Dan

7 likes

An infographic titled 'Linux netcat Command Examples' lists various `nc` commands for network tasks like port scanning, file transfer, creating shells, and streaming. It includes commands for TCP/UDP, IPv6, and persistent listeners, credited to Dan Nanni.
Useful netcat command examples
Netcat is the Swiss army knife of networking. It lets you read and write data over TCP or UDP, and infosec folks use it all the time for things like quick port scans, grabbing service banners, or setting up reverse shells. Here are useful netstat command examples 😎👆 Find high-res pdf ebooks w
Learn Linux with Dan

Learn Linux with Dan

7 likes

John 13:31-35 | The New Command 📖
Today’s Bible reading & notes 📖 John 13:31-35 | The New Command 📖 ♥️ Today’s Heart Check: Do I love others the way Jesus has loved me, or do I only love when it is easy, safe, or returned? #i love reading my bible #findgod📖🙏🏻 #readingthroughmybible #biblenotes #biblestudy
MAE ♡

MAE ♡

36 likes

A Linux watch command cheatsheet created by Dan Nanni, listing various commands to monitor system metrics in real-time. Examples include tracking CPU/memory usage, disk space, log file growth, network activity, and system errors, with refresh intervals specified.
Linux watch command cheatsheet
Ever wish you could just run a command and keep seeing it update automatically as things change? That is exactly what the watch command does on Linux Here are useful examples of the watch command 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org
Learn Linux with Dan

Learn Linux with Dan

5 likes

10 Style Categories: ✨ROMANTIC✨ with examples 🫶
Romantic closet starters, in-depth explanation and examples 💕 #romanticstyle #feminineenergy #femininestyle #styleinspo #personalstylist
Staples & Statements

Staples & Statements

93 likes

An illustration titled 'Expression in Japanese' showing six cartoon faces, each depicting an emotion with its Japanese word and romaji. The emotions are Happy, Sad, Cool, Sleepy, Speechless, and Crazy, presented in a grid format on a light purple background.
Expressions in Japanese: Sentence Examples
Here's sentence examples, I challenge you to use one of the expressions in your own sentence in the comments. 👏😁 1. Happy: 嬉しい!今日の試験に合格した。 (Ureshii! Kyou no shiken ni goukaku shita.) I'm happy! I passed today's exam. 2. Sad: 悲しい。彼女が引っ越すなんて。 (Kanashii. Kanojo ga hikk
Study Gal 🌸

Study Gal 🌸

188 likes

Useful awk command examples
Awk is a powerhouse text tool — it can scan files or streams, match patterns, and run custom actions on the fly, making it perfect for quick data filtering, parsing, and one-line automation Here are useful awk command examples 😎👇 Find high-res pdf books with all my Linux infographics at https
Learn Linux with Dan

Learn Linux with Dan

4 likes

examples of self sabotage and how to stop
❌ you know what you need to get done but you don’t do it ➡️ you’re afraid that when you actually do the work, you’ll fail ⬇️ how to stop this ⬇️ the more often that you prove to yourself that you are capable of doing things, the easier doing them will be. the more often you fail and realize t
staci york 💛🍋

staci york 💛🍋

3240 likes

A white Toyota Chaser JZX100 is shown from an elevated front-side angle, parked on asphalt, with the text "INTRODUCING TOYOTA CHASER" overlaid.
A white Toyota Chaser JZX100 is captured in motion from a front-side perspective on a road, with sunlight glinting off its surface.
A white Toyota Chaser JZX100 is seen in motion from a side view on a road, with sunlight creating a bright background.
This color 🤍
The 1995 Toyota Chaser JZX100 is the ultimate Japanese drift sedan sleeper, featuring a 2.5L 1JZ-GTE twin-turbo inline-6 producing 280 hp. Its rear-wheel drive platform and robust mechanicals made it a favorite for grassroots motorsport. While production numbers were high in Japan, clean example
gearsandpistons

gearsandpistons

7 likes

Critical analysis essay examples
Critical analysis essay examples
Assignments & Exams Helper

Assignments & Exams Helper

5 likes

Command your healing
Before this day speaks for you, you speak for it. Command the morning with Scripture-based healing decrees. This is not just a prayer — this is a declaration of faith, healing, and restoration through Jesus Christ. Speak the Word. Agree with heaven. Receive healing. 👉 Comment what you’re believ
Tru3ladie

Tru3ladie

164 likes

DIY Command Center
I created this family command center where we enter and exit the house to help keep our family organized. It’s perfect because it reminds me to stay on top of things! #diyhomeprojects #painthacks #organizedhome
missjessicanicolehome

missjessicanicolehome

3317 likes

An infographic titled 'OpenSSH Command Examples' by Dan Nanni, listing twelve practical OpenSSH commands for secure remote logins, file transfers, and command execution, including custom port connections, key authentication, preventing timeouts, running remote commands, port forwarding, jump servers, copying public keys, custom config files, SOCKS proxies, and connection multiplexing.
OpenSSH command examples
OpenSSH is a versatile suite of client and server tools that use the SSH protocol to provide encrypted and authenticated communication over networks. This toolset is heavily used for secure remote logins, file transfers, and command execution in various cloud and on-premises environments Here ar
Learn Linux with Dan

Learn Linux with Dan

6 likes

UGC Examples | How to Aesthetically Showcase ✨
I’m definitely not a pro, but investing your time in getting the right angles and shots will increase your chances in having your client come back for more content from you! 🤳 I also took the time to really invest in my filming set up cause I don’t have the fanciest camera equipment and the late
Shannon-Nicole

Shannon-Nicole

15 likes

Some examples of regular verbs.
Elom’s Genuine English

Elom’s Genuine English

0 likes

Start today
Warrior Activated – Day 2 ⚔️ Command One Small Action Day 1 was about catching the command: 👉 “I’ll do it tomorrow.” Day 2 is about issuing a new command. Here’s the truth: You don’t get stuck because tasks are too big. You get stuck because your command structure breaks down. You
JLBC_recruiter

JLBC_recruiter

2 likes

Linux netcat command examples
The netcat command lets you read from and write to network connections using TCP or UDP. Its flexibility makes it a must-have for infosec professionals, who use it for tasks such as port scanning, banner grabbing, and setting up reverse shells during penetration tests. Here are useful netstat co
Learn Linux with Dan

Learn Linux with Dan

10 likes

A woman in gym attire checks her watch in a gym, with text overlay "2025 BEGINNER GYM SPLIT WHAT IS A SPLIT? HOW DO I MAKE ONE?" and the user's handle.
A weekly gym split example is displayed on a note graphic over a gym background, detailing daily workouts like lower body, upper body, cardio, glute focus, full body, and rest days.
Text explaining "WHAT IS A GYM SPLIT?!?" with its definition, benefits, results, and examples of muscle groups, set against a gym floor with equipment.
2025 Beginner Gym Split || What is it? EXAMPLES🫶🏼
Building strength can feel intimidating, but this beginner-friendly gym split is here to guide you every step of the way! 🏋️‍♀️ 💡 Swipe through for: ✨ What a gym split is. ✨ A simple weekly plan to follow. ✨ Tips for sticking to your routine. 💬 Comment your favorite gym day—Lower body? Glu
✰ Izzybellamar

✰ Izzybellamar

161 likes

A store aisle display featuring various Command brand damage-free hanging products, including hooks, picture hanging strips, and poster strips. A green overlay with white text reads 'COLLEGE DORM NECESSITY COMMAND HOOKS', emphasizing their importance for dorm room decoration.
A hand holds a package of 3M Command Large Picture Hanging Strips, designed to hold up to 15 lbs (7 kg). The product is described as great for larger frames, capable of holding items up to 24" x 36" (60 cm x 90 cm).
A hand holds a package of 3M Command Small Wire Hooks, designed to hold up to 0.5 lb (225 g). The product is highlighted as great for lighter items, offering damage-free hanging and clean removal.
College Dorm Necessity - Command Hooks
One thing you will need if you plan on decorating your dorm room walls is command strips and a lot of them! You also need a variety because some things require a little more strength. I have loved all of these types for my dorm room! They held up well and even held heavier things that I did not exp
Caitlynn.Osting

Caitlynn.Osting

58 likes

Elevate your LinkedIn (w/ Examples)
Check out Part 1 for more tips! If you don’t have a LinkedIn, go make one right now! TRUST <3 Get those connections up to 500+ and connect with other students at your college as well as alumni. You your bio to tell your story and include your contact info there. #lemon8partner #careeradvic
dhillon.diary

dhillon.diary

40 likes

How to budget the right way!!
✅ 1. Know Your Net Income Start with what you actually take home after taxes and deductions. • Don’t use your gross salary. • If your income fluctuates, average your income over the last 3–6 months. ✅ 2. Track Your Spending Before making a budget, understand where your
Briel💵

Briel💵

1388 likes

A smiling young woman with long dark hair stands outdoors, with text overlay "ELEVATE your in PART 1 (W/ EXAMPLES) FOR COLLEGE STUDENTS." The word "in" is represented by the LinkedIn logo, indicating the topic is about enhancing LinkedIn profiles.
A laptop and a drink cup on a desk, with pink text boxes providing LinkedIn advice. The text explains the "XYZ format" for bullet points in job descriptions, with examples of a less effective and a more impactful statement.
A table with a pink tumbler and roses, featuring pink text boxes with LinkedIn headline advice. The text instructs to use relevant keywords and provides an example headline: "MARKETING & DATA ANALYTICS I SOCIAL MEDIA CONTENT CREATOR | WOMEN@DIOR MENTEE EX -SAVAGE X FENTY, VICTORIA'S SECRET INTERN."
Elevate your LinkedIn (w/ Examples)
If you don’t have a LinkedIn, go make one right now! TRUST<3 Use the XYZ format for your bullet points when describing your past experiences. Customize your headline with relevant keywords. #lemon8partner #careeradvice #collegestudentadvice #collegelife #career #careertips #l
dhillon.diary

dhillon.diary

24 likes

Linux nmcli command examples
nmcli is a CLI tool that talks to NetworkManager—lets you create and manage connections, check status, and run basic network diagnostics right from the terminal Here are useful nmcli command examples 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org
Learn Linux with Dan

Learn Linux with Dan

3 likes

An NBA2K player build screen featuring Chris Paul, showing his archetype as a "2-Way Middy Playmaker." It lists player details: Point Guard, 6'0" height, 180 lbs weight, 6'4" wingspan, and highlights shades of Chris Paul, Tim Hardaway, and John Stockton.
A screenshot of NBA2K attribute ratings, displaying finishing stats like Close Shot (72), Driving Layup (80), and Post Control (67). Shooting stats include Mid-Range Shot (87), Three-Point Shot (83), and Free Throw (91), along with Badge Tier 1 icons.
A screenshot of NBA2K attribute ratings, detailing playmaking stats such as Pass Accuracy (94), Ball Handle (94), and Speed With Ball (86). Defensive stats include Perimeter Defense (92) and Steal (85), with a mention of "Build By Badges."
CP3. Control. Precision. Leadership. Command.
Day 18 of GOATmas Chris Paul A master of pace and control. CP3 doesn’t rush he dictates. Every dribble has purpose, every pass is on time, and every midrange jumper is automatic. This build is built to lead, organize, and punish mistakes without forcing anything. Basketball at its most surgi
WICKED

WICKED

10 likes

Command the attention you want! Understand this 🩷
Real authority doesn’t announce itself. It settles in the room before you speak. You don’t need to harden to lead. You don’t need to out-talk anyone. You don’t need armor. The strongest women I know lead with clarity, not force. They hold boundaries without raising their voice. They list
A Woman’s Business

A Woman’s Business

198 likes

5 powerful journal prompts for healing ❤️‍🩹(examples)
Journaling prompts help you slow down and tune into your inner thoughts. They guide you toward meaningful reflections without pressure. They also encourage fresh perspectives and personal insigh💡t. The screenshots of the examples are taken from a cute digital journal named "Lifelight"
Luna.lifelight

Luna.lifelight

77 likes

An infographic titled 'Linux lsof Command Examples' by Dan Nanni, detailing various uses of the lsof command. It covers listing open files by process, user, directory, or filename; listing network connections and sockets by port or protocol; and other usages like listing Unix domain sockets or killing user activities.
Linux lsof command examples
If I had to pick a personal favorite among lesser-known Linux commands, it would be lsof. It’s my go-to tool for discovering which files are open and which processes are using them. Since everything in Linux is treated as a file, lsof proves to be surprisingly powerful and endlessly useful Here
Learn Linux with Dan

Learn Linux with Dan

3 likes

A young woman with long brown hair, eyes closed and smiling, sits in a car. Text overlay reads "how i improved my SELF ESTEEM" and "you need to hear this," with the Lemon8 logo and username.
Against a blurry gym background, text titled "i made myself UNCOMFORTABLE" explains how discomfort builds confidence. A red box lists examples like "a hard workout" and "a cold shower," with the Lemon8 logo.
Over a blurry indoor scene, text titled "i spoke POSITIVE AFFIRMATIONS" describes how positive self-talk boosts confidence. A red box provides examples such as "I am beautiful exactly as I am," with the Lemon8 logo.
3 ways to boost your self esteem (with examples)
I used to have horrible self esteem. My confidence levels were at an all time low. My negative self talk was terrible and I constantly doubted myself. Here’s exactly how I overcame this and grew my self esteem: 1. I made myself uncomfortable Self esteem and confidence often grows in discomfo
Rebekah Joy

Rebekah Joy

589 likes

A brown Bible with a decorative charm bookmark featuring various small charms like 'Faith over fear' and 'Love God', resting on a textured surface.
An open Bible displaying text on the left page and numerous colorful sticky tabs marking sections on the right page, with '1 KINGS 12:24' visible.
An open Bible showing the 'OLD TESTAMENT' section with many colorful sticky tabs labeled with spiritual themes like 'Salvation', 'Healing', 'Love', and 'God's Promise's'.
Examples of loaded bibles.
My bibles also come in mega loaded which includes over 200 tip ins, 66 books of the Bible summary, reading trackers, and a ton of resources. #bloomingbibles # loadedbibles # megaloadedbibles #bible journaling Millbrook
Blooming Bibles

Blooming Bibles

20 likes

Stream Command Ideas
The rest will be posted in discord. Next question is "What Bot tools do you use?" #streamer #streamertips #twitch
Meri

Meri

6 likes

A flat lay of two journals (brown with faces, blue with leaves) and two lit candles, with 'JOURNALING iDEAS' text and a 'Swipe' icon featuring a cute yellow character holding a heart.
A screenshot from a journaling app showing a prompt: 'What old story about yourself are you ready to release? What new truth do you want to claim?' and a detailed response about self-acceptance.
A journaling app screenshot displaying the prompt: 'What would self-compassion say to you right now?' and a response about doing your best and not failing, with a supportive AI comment.
Journaling prompts for healing🌟❤️‍🩹 (with examples)
Healing isn't linear, and sometimes the hardest part is knowing where to start. These journaling prompts are designed to help you dig beneath the surface to access the emotions. The examples of the three questions are shown in the pics. They are the screenshots from an app named "Life
Luna.lifelight

Luna.lifelight

16 likes

Fall command station 🥰
Blooming Hood

Blooming Hood

5 likes

An infographic titled 'Linux lsof Command Examples' by Dan Nanni, detailing various uses of the lsof command. It categorizes examples for listing open files, network connections and sockets, and other usages like Unix domain sockets and killing user activities.
Linux lsof command examples
My underrated Linux pick is the lsof command. It tells you exactly which files are open and which processes are using them. Because Linux treats everything as a file, this tiny command ends up being insanely powerful and useful in everyday troubleshooting. Here are useful lsof command examples 😎
Learn Linux with Dan

Learn Linux with Dan

2 likes

An infographic titled 'Linux pv Command Examples' presents various `pv` commands for visualizing data transfer progress. Examples include monitoring file copying, merging, compression, decompression, SCP transfers, disk backups, and tarball operations, demonstrating how `pv` shows progress, speed, and ETA during file operations.
Useful pv command examples
pv (Pipe Viewer) is one of those hidden gems on Linux. Just toss it into a pipe (pipes are already super convenient) and you get a live view of progress, speed, and ETA as data flows through 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org #linux
Learn Linux with Dan

Learn Linux with Dan

3 likes

What Does 'So' Mean? 5 Easy Examples to Learn
#LearnEnglish #EnglishLanguage #EnglishLessons #EnglishMadeEasy #LearnWithMe What Does 'So' Mean? 5 Easy Examples to Learn English
JEFF JEUDY

JEFF JEUDY

89 likes

UGC EXAMPLES
#lemon8diarychallenge #ugccreator #ugccreatortips #ugcexample #ugcexamples
Alyssia

Alyssia

2 likes

Her Chain of Command 🖤
Chatgpt
Mmichelle Matth

Mmichelle Matth

6 likes

See more