Translate

Saturday, 17 January 2026

What is " Computer Forensics " in Cyber Security

 In the world of cybersecurity, Computer Forensics (also known as Digital Forensics) is the "CSI" of the digital world. While standard cybersecurity focuses on prevention (building walls and locks), computer forensics focuses on investigation and recovery (finding out who broke in, how they did it, and what they took).

It is the practice of collecting, preserving, and analyzing digital evidence in a way that is legally admissible in a court of law.


1. The Computer Forensics Process

A forensic investigation follows a strict, scientific process to ensure that the evidence hasn't been tampered with.

  • Identification: Determining what devices (laptops, phones, servers, USBs) might contain evidence.

  • Preservation: Preventing any changes to the data. This usually involves creating a "Forensic Image" (a bit-for-bit clone) of the drive so the original remains untouched.

  • Analysis: Using specialized tools to recover deleted files, hidden folders, and encrypted data to reconstruct a timeline of events.

  • Reporting: Summarizing the findings into a clear, technical report that can be used by a company's board or as evidence in a trial.


2. Common Techniques & Tools

Forensic experts use various "magic" tricks to find evidence that hackers or criminals think they have erased.

Key Techniques

  • Deleted File Recovery: When you "delete" a file, it isn't actually gone; the computer just marks that space as "available." Forensics can "carve" these files back out before they are overwritten.

  • Live Analysis: Examining a computer while it is still running to capture Volatile Data (data in RAM) that disappears once the power is cut.

  • Steganography Discovery: Finding secret data hidden inside seemingly innocent files, like a text message hidden inside a JPEG image.

  • Cross-Drive Analysis: Comparing data across multiple devices to find patterns or connections between different suspects.

Popular Tools

ToolBest Used For...
EnCase / FTKThe "Gold Standard" for imaging drives and searching for evidence.
WiresharkAnalyzing network traffic to see what a hacker sent over the internet.
AutopsyAn open-source tool for digging through hard drives and smartphones.
VolatilitySpecifically used for Memory Forensics (analyzing RAM).

3. Real-World Examples

Example A: The "BTK" Serial Killer Case (Metadata)

One of the most famous forensic wins was the capture of Dennis Rader (the BTK killer). After 30 years of silence, he sent a floppy disk to a news station. Forensic analysts found a deleted Microsoft Word document on the disk. They looked at the Metadata (hidden data about the file) and found the name "Dennis" and a link to a specific church. This digital footprint led directly to his arrest.

Example B: Insider Data Theft (The "Disgruntled Employee")

An engineer at a tech firm decides to quit and join a competitor. Before leaving, he plugs in a personal USB and copies 5,000 secret design files. He then deletes his browser history and the files from his computer.

  • The Forensics: Investigators use Registry Analysis to see exactly when the USB was plugged in and File Carving to recover the "deleted" list of copied files. This provides the company with proof to sue for intellectual property theft.

Example C: Ransomware Investigation

A hospital's servers are locked by ransomware.

  • The Forensics: Experts analyze the Event Logs to find the "Patient Zero" (the first infected computer). They discover the attack started through a phishing email opened three weeks prior. This helps the hospital close the security hole so it doesn't happen again.


4. Why It Matters in Cyber Security

Computer forensics is essential for:

  1. Incident Response: When a breach happens, forensics tells you the "Who, What, When, and How."

  2. Legal Action: You cannot sue a hacker or fire an employee for "hacking" without a forensic report that proves it.

  3. Regulatory Compliance: Many laws (like GDPR or HIPAA) require companies to prove exactly what data was leaked during a breach.


సైబర్ సెక్యూరిటీ ప్రపంచంలో కంప్యూటర్ ఫోరెన్సిక్స్ (Computer Forensics) అనేది డిజిటల్ నేరాలను పరిశోధించే ఒక శాస్త్రం. దీన్ని "డిజిటల్ ప్రపంచపు CSI" అని పిలవవచ్చు. సాధారణ సైబర్ సెక్యూరిటీ అనేది దాడులు జరగకుండా ఆపడంపై దృష్టి పెడితే, కంప్యూటర్ ఫోరెన్సిక్స్ అనేది దాడి జరిగిన తర్వాత—ఎవరు చేశారు? ఎలా చేశారు? ఏ డేటా దొంగిలించారు?—అనే విషయాలను చట్టబద్ధమైన ఆధారాలతో నిరూపించడంపై దృష్టి పెడుతుంది.

దీని గురించి పూర్తి వివరాలు ఇక్కడ ఉన్నాయి:


1. కంప్యూటర్ ఫోరెన్సిక్స్ ప్రక్రియ (The Process)

డిజిటల్ ఆధారాలు కోర్టులో చెల్లుబాటు కావాలంటే, ఈ క్రింది దశలను కచ్చితంగా పాటించాలి:

  • గుర్తింపు (Identification): ఏ పరికరాల్లో (ల్యాప్‌టాప్, ఫోన్, పెన్‌డ్రైవ్) ఆధారాలు ఉండే అవకాశం ఉందో గుర్తించడం.

  • భద్రపరచడం (Preservation): ఉన్న డేటా ఏమాత్రం మారకుండా జాగ్రత్త పడటం. దీని కోసం అసలు డిస్క్ నుండి "ఫోరెన్సిక్ ఇమేజ్" (బిట్-టు-బిట్ కాపీ) తీసుకుంటారు.

  • విశ్లేషణ (Analysis): ప్రత్యేకమైన సాఫ్ట్‌వేర్‌లను ఉపయోగించి డిలీట్ చేసిన ఫైల్స్, పాస్‌వర్డ్‌లు మరియు దాచిన సమాచారాన్ని బయటకు తీయడం.

  • నివేదిక (Reporting): కనుగొన్న ఆధారాలన్నింటినీ కలిపి ఒక సాంకేతిక నివేదికను తయారు చేయడం. ఇది కోర్టులో సాక్ష్యంగా పనికొస్తుంది.


2. ముఖ్యమైన పద్ధతులు మరియు సాధనాలు (Techniques & Tools)

పద్ధతులు:

  • డిలీట్ చేసిన ఫైల్స్ రికవరీ: ఫైల్ డిలీట్ చేసినా అది హార్డ్ డిస్క్‌లో ఎక్కడో ఒకచోట ఉంటుంది. దాన్ని తిరిగి వెలికితీస్తారు.

  • లైవ్ అనాలిసిస్: కంప్యూటర్ రన్ అవుతున్నప్పుడే RAM లో ఉన్న తాత్కాలిక సమాచారాన్ని సేకరించడం.

  • మెటాడేటా విశ్లేషణ: ఒక ఫైల్ ఎప్పుడు సృష్టించబడింది, ఏ కంప్యూటర్‌లో తయారైంది వంటి వివరాలను చూడటం.

సాధనాలు (Tools):

సాధనం (Tool)దేనికి ఉపయోగిస్తారు?
EnCase / FTKహార్డ్ డిస్క్‌లను స్కాన్ చేయడానికి మరియు ఇమేజింగ్ చేయడానికి.
Wiresharkఇంటర్నెట్ ద్వారా ఏ డేటా బయటకు వెళ్తుందో చూడటానికి.
Autopsyడిలీట్ అయిన ఫైల్స్ మరియు హిస్టరీని వెతకడానికి.
Volatilityకంప్యూటర్ మెమరీ (RAM) ని పరిశోధించడానికి.

3. నిజ జీవిత ఉదాహరణలు (Real-World Examples)

ఉదాహరణ A: BTK కిల్లర్ కేసు (మెటాడేటా సహాయంతో)

అమెరికాలో ఒక సీరియల్ కిల్లర్ (BTK) పోలీసులకు ఒక ఫ్లాపీ డిస్క్ పంపాడు. పోలీసులు ఆ డిస్క్‌లోని ఒక డిలీట్ చేసిన వర్డ్ డాక్యుమెంట్‌ను రికవరీ చేశారు. దాని మెటాడేటాను పరిశీలించగా, అది ఒక చర్చిలో ఉన్న కంప్యూటర్‌లో తయారైనట్లు, దాని యూజర్ పేరు "డెన్నిస్" అని తెలిసింది. ఆ ఆధారంతోనే డెన్నిస్ రేడర్ అనే వ్యక్తిని పట్టుకున్నారు.

ఉదాహరణ B: కంపెనీ డేటా దొంగతనం (Insider Threat)

ఒక ఉద్యోగి కంపెనీ నుండి తప్పుకునే ముందు కొన్ని రహస్య ఫైల్స్‌ను తన వ్యక్తిగత USB లో కాపీ చేసుకున్నాడు. తర్వాత ఆ ఫైల్స్‌ను కంప్యూటర్ నుండి డిలీట్ చేశాడు.

  • ఫోరెన్సిక్స్: ఇన్వెస్టిగేటర్లు ఆ కంప్యూటర్ యొక్క Registry ని తనిఖీ చేసి, ఏ సమయంలో ఏ USB పెన్ డ్రైవ్ కనెక్ట్ అయిందో కనుగొన్నారు. డిలీట్ చేసిన ఫైల్స్‌ను రికవరీ చేసి, అతను డేటా దొంగిలించాడని నిరూపించారు.

ఉదాహరణ C: రాన్సమ్‌వేర్ దాడి (Ransomware Investigation)

ఒక ఆసుపత్రి సర్వర్లు హ్యాక్ అయ్యాయి. ఫోరెన్సిక్స్ టీమ్ Event Logs ని పరిశీలించి, దాడి ఎక్కడ మొదలైందో కనుగొన్నారు. ఒక ఉద్యోగికి వచ్చిన ఫేక్ ఈమెయిల్ (Phishing) ద్వారా హ్యాకర్లు లోపలికి వచ్చారని నిర్ధారించి, భవిష్యత్తులో అలాంటివి జరగకుండా అడ్డుకున్నారు.


4. సైబర్ సెక్యూరిటీలో దీని ప్రాముఖ్యత

  1. నేరస్థులను పట్టుకోవడం: హ్యాకర్లను చట్టపరంగా శిక్షించడానికి బలమైన ఆధారాలు ఇస్తుంది.

  2. లోపాలను సరిదిద్దడం: దాడి ఎలా జరిగిందో తెలిస్తే, భవిష్యత్తులో అలాంటి దాడులు జరగకుండా జాగ్రత్త పడవచ్చు.

  3. నష్ట నివారణ: కంపెనీల నుండి దొంగిలించబడిన సమాచారాన్ని రికవరీ చేయడంలో సహాయపడుతుంది.

What is "Computer Abuse " in Cyber Security

 In cyber security, Computer Abuse refers to the unethical, unauthorized, or improper use of a computer system, network, or data. While often used interchangeably with "computer crime," it is technically a broader term that includes actions that might not be strictly illegal under specific criminal statutes but are still considered a violation of organizational policy or ethical standards.

Think of it this way: Computer Crime is when you break the law (like stealing money); Computer Abuse includes breaking the law plus things that are just "wrong" or "against the rules" (like browsing a coworker's private folders out of curiosity).


1. Computer Abuse vs. Computer Crime

Understanding the nuance between these two is critical for security professionals:

FeatureComputer AbuseComputer Crime
DefinitionUnethical or unauthorized use.Illegal acts involving computers.
StandardBased on "Acceptable Use Policies" (AUP).Based on Federal/State Laws.
ConsequencesTermination, suspension, or reprimand.Fines, prison time, or criminal record.
ExamplesWatching Netflix at work, "snooping."Ransomware, identity theft, fraud.

2. Categories and Detailed Examples

To better understand computer abuse, we can categorize it by the "intent" and "context" of the action.

A. Workplace Policy Violations

This is the most common form of abuse. It involves employees using company resources for tasks that are not work-related.

  • Excessive Personal Use: Spending hours of work time on social media, online shopping, or day-trading stocks.

  • Accessing Inappropriate Content: Using a work laptop to view adult content, gambling sites, or hate speech.

  • Resource Hoarding: Using the corporate network to download massive files (like 4K movies or torrents), which slows down the internet for the rest of the company.

B. Unauthorized Access (Snooping)

This occurs when someone has access to a system but uses it to view information they have no "business need" to see.

  • The "Curious" Admin: A system administrator who reads the CEO’s private emails or looks at the HR files to see how much their colleagues are being paid.

  • Medical Record Snooping: A nurse in a hospital looking up the medical history of a celebrity or a neighbor out of curiosity.

  • Customer Privacy Abuse: A customer support agent using a customer’s phone number from the database to contact them for personal reasons.

C. Technical Sabotage and Malice

This often involves "Insider Threats" where a disgruntled person uses their technical knowledge to cause harm.

  • Logic Bombs: A programmer writes a "bomb" into the code that will delete the company’s entire database if their name is ever removed from the payroll (a classic case of revenge).

  • Data Diddling: Changing data before it is entered into the system (e.g., a clerk slightly changing the numbers on an invoice so the extra money goes to their account).

  • Shadow IT: An employee setting up their own unauthorized server or cloud storage within the company network to bypass security filters.

D. Social and Ethical Abuse

These actions affect people more than they affect the hardware or data.

  • Cyberbullying/Harassment: Using work email or internal Slack channels to send threatening or demeaning messages to a coworker.

  • Spamming: Using a company's mail server to send out thousands of unsolicited marketing emails.


3. The Legal Framework: CFAA

In the United States, the primary law governing these acts is the Computer Fraud and Abuse Act (CFAA).

The CFAA makes it a crime to "intentionally access a computer without authorization or exceed authorized access." This is the legal "teeth" behind computer abuse. If a company can prove that an employee intentionally bypassed a security gate to get data they weren't supposed to have, that "abuse" can quickly be prosecuted as a "federal crime."


4. Why Does it Matter?

Even "minor" computer abuse has a ripple effect on an organization:

  1. Productivity Loss: Time spent on non-work activities.

  2. Security Risks: Visiting "dodgy" websites can lead to malware infections.

  3. Legal Liability: If an employee uses a work computer to harass someone, the company might be held liable.

  4. Data Integrity: Unauthorized "snooping" or minor data changes can ruin the accuracy of a company's records.

సైబర్ సెక్యూరిటీలో "కంప్యూటర్ అబ్యూస్" (Computer Abuse) అంటే ఏమిటో కింద వివరణాత్మక సమాచారం ఉంది:

కంప్యూటర్ అబ్యూస్ అంటే ఒక కంప్యూటర్ సిస్టమ్‌ను, నెట్‌వర్క్‌ను లేదా డేటాను అనైతికంగా, అనధికారికంగా లేదా తప్పుడు పద్ధతిలో ఉపయోగించడం. ఇది ఎల్లప్పుడూ చట్టపరమైన నేరం (Computer Crime) కాకపోవచ్చు, కానీ ఇది సంస్థ యొక్క నిబంధనలకు లేదా నైతిక విలువలకి విరుద్ధం.

సరళంగా చెప్పాలంటే: కంప్యూటర్ క్రైమ్ అనేది చట్టాన్ని ఉల్లంఘించడం (ఉదాహరణకు బ్యాంక్ అకౌంట్ హ్యాక్ చేయడం). కంప్యూటర్ అబ్యూస్ అనేది ఆఫీసు నిబంధనలను అతిక్రమించడం (ఉదాహరణకు ఆఫీసు టైమ్‌లో వ్యక్తిగత పనుల కోసం ఇంటర్నెట్‌ను విపరీతంగా వాడటం).


కంప్యూటర్ అబ్యూస్ vs కంప్యూటర్ క్రైమ్

అంశంకంప్యూటర్ అబ్యూస్ (Abuse)కంప్యూటర్ క్రైమ్ (Crime)
నిర్వచనంఅనైతిక లేదా పాలసీలకు విరుద్ధమైన పని.చట్టవిరుద్ధమైన పని.
ఆధారంసంస్థ యొక్క Acceptable Use Policy (AUP).ప్రభుత్వ సైబర్ చట్టాలు.
ఫలితంఉద్యోగం పోవడం లేదా హెచ్చరికలు.జరిమానాలు లేదా జైలు శిక్ష.
ఉదాహరణఆఫీసులో రోజంతా సినిమాలు చూడటం.ఒకరి డేటాను దొంగిలించి డబ్బులు అడగడం.

కంప్యూటర్ అబ్యూస్‌కు ఉదాహరణలు (Detailed Examples)

కంప్యూటర్ అబ్యూస్‌ను వివిధ రకాలుగా వర్గీకరించవచ్చు:

1. ఆఫీసు వనరుల దుర్వినియోగం (Workplace Resource Abuse)

ఉద్యోగులు తమకు ఇచ్చిన కంప్యూటర్ లేదా ఇంటర్నెట్‌ను ఆఫీసు పని కోసం కాకుండా వేరే వాటికి వాడటం.

  • అధిక వ్యక్తిగత ఉపయోగం: పని మానేసి గంటల తరబడి సోషల్ మీడియా (Facebook, Instagram) చూడటం లేదా ఆన్‌లైన్ షాపింగ్ చేయడం.

  • అనుచిత కంటెంట్: ఆఫీసు నెట్‌వర్క్‌లో పోర్న్ లేదా గేమింగ్ వెబ్‌సైట్‌లను చూడటం.

  • బ్యాండ్‌విడ్త్ హార్డింగ్: ఆఫీసు ఇంటర్నెట్ వాడి పెద్ద పెద్ద సినిమాలు లేదా సాఫ్ట్‌వేర్లను (Torrents) డౌన్‌లోడ్ చేయడం, దీనివల్ల ఇతరులకు ఇంటర్నెట్ స్లో అవుతుంది.

2. అనధికారికంగా సమాచారాన్ని చూడటం (Unauthorized Access/Snooping)

తనకు సంబంధం లేని సమాచారాన్ని కేవలం కుతూహలం (Curiosity) కొద్దీ చూడటం.

  • సహోద్యోగుల ఫైల్స్ చూడటం: తోటి ఉద్యోగి కంప్యూటర్ లాక్ చేయనప్పుడు, వారి వ్యక్తిగత ఫోల్డర్లు లేదా జీతం వివరాలు చూడటం.

  • వైద్య రికార్డుల పరిశీలన: ఒక హాస్పిటల్ ఉద్యోగి తనకు సంబంధం లేని పేషెంట్ల (ఉదాహరణకు సెలబ్రిటీల) మెడికల్ రిపోర్టులు చూడటం.

  • కస్టమర్ ప్రైవసీ: బ్యాంక్ లేదా టెలికాం ఉద్యోగి తనకున్న అధికారంతో తన స్నేహితుల లేదా మాజీ భాగస్వాముల ఫోన్ కాల్ డేటాను చూడటం.

3. ఉద్దేశపూర్వక అంతరాయం (Malicious Abuse)

వ్యక్తిగత కక్షతో లేదా కోపంతో చేసే పనులు.

  • లాజిక్ బాంబ్స్ (Logic Bombs): ఒక ప్రోగ్రామర్ తను ఉద్యోగం నుండి తీసివేస్తే, కంపెనీ డేటా మొత్తం డిలీట్ అయిపోయేలా ఒక కోడ్ రాసి పెట్టడం.

  • డేటా మార్చడం (Data Diddling): లెక్కల్లో తప్పులు చేసి కంపెనీకి నష్టం కలిగించడం లేదా స్వంత లాభం పొందడం.

4. సోషల్ మీడియా మరియు కమ్యూనికేషన్ అబ్యూస్

  • సైబర్ బుల్లీయింగ్: ఆఫీసు ఈమెయిల్ లేదా స్లాక్ (Slack) ఉపయోగించి సహోద్యోగులను వేధించడం లేదా బెదిరించడం.

  • స్పామింగ్: కంపెనీ మెయిల్ సర్వర్ ఉపయోగించి వేలకొద్దీ అనవసరమైన ప్రకటనలు (Spam) పంపడం.


ఇది ఎందుకు ప్రమాదకరం?

కంప్యూటర్ అబ్యూస్ చిన్న విషయంగా అనిపించినా, దీనివల్ల సంస్థలకు పెద్ద నష్టాలు వస్తాయి:

  1. ఉత్పాదకత తగ్గడం: ఉద్యోగులు సమయాన్ని వృధా చేయడం వల్ల పని ఆగిపోతుంది.

  2. భద్రతా ముప్పు: అనవసరమైన వెబ్‌సైట్లు చూడటం వల్ల మాల్‌వేర్ (Malware) లేదా వైరస్‌లు ఆఫీసు నెట్‌వర్క్‌లోకి వచ్చే అవకాశం ఉంటుంది.

  3. డేటా లీక్: అనధికారికంగా డేటా చూడటం వల్ల గోప్యత దెబ్బతింటుంది.


మీ కార్యాలయంలో లేదా సంస్థలో ఇలాంటి పనులు జరగకుండా ఉండటానికి "Acceptable Use Policy" (AUP) రూపొందించడం చాలా ముఖ్యం.

Friday, 16 January 2026

Git, branching

 In Git, branching is like creating a parallel version of your project. It allows you to "branch off" from the main code to work on a new feature or fix a bug without messing up the stable version everyone else is using.

Git branching in telugu


Think of it like a tree: the main branch is the trunk, and every time you want to try something new, you grow a side branch. Once you’re happy with your work, you can "merge" that branch back into the trunk.


Basic Example 1: Creating a New Feature

Imagine you are building a website and want to add a "Contact Us" page. You don't want to break the homepage while you're still writing the code for the new page.

  1. Create a branch: You create a branch called add-contact-page.

  2. Work in isolation: You write your HTML and CSS on this branch. The main branch stays exactly as it was.

  3. Merge: Once the contact page is perfect, you merge the add-contact-page branch into main. Now, the live website has the new feature.

Basic Example 2: Fixing an Urgent Bug (Hotfix)

Suppose your website is live, and someone discovers that the "Sign Up" button is broken. You are currently in the middle of a big 2-week project on a different branch.

  1. Switch to Main: You quickly switch back to the main branch (the stable code).

  2. Create a Hotfix branch: You create a temporary branch called fix-signup-button.

  3. Fix and Deploy: You fix the bug on this tiny branch and merge it immediately back into main.

  4. Resume Work: You switch back to your long-term project branch and continue where you left off. The bug is fixed, and your big project was never interrupted.


Core Commands to Know

  • git branch <name>: Creates a new branch.

  • git checkout <name> (or git switch <name>): Moves you onto that branch.

  • git merge <name>: Combines the work from one branch into your current one.

  • git branch: Lists all the branches in your project.

-------------

Here is the complete list of Git branching commands organized by their logical order in a typical development workflow.


1. Viewing Branches (Inspection)

Before you start working, you need to see which branches exist and where you are currently.

  • git branch: Lists all local branches. The branch marked with an asterisk * is the one you are currently on.

  • git branch -v: Shows the last commit message on each branch.

  • git branch -a: Lists all branches, including remote branches (those on GitHub/GitLab).

2. Creating and Moving (Navigation)

These commands are used when you want to start a new task or switch between existing tasks.

  • git branch <name>: Creates a new branch but keeps you on your current branch.

  • git switch <name>: Moves you from your current branch to the specified branch.

  • git switch -c <name>: (Highly Recommended) Creates a new branch and switches to it immediately. (This is the modern alternative to git checkout -b).

3. Renaming (Maintenance)

Useful if you made a typo or want to give a branch a more descriptive name.

  • git branch -m <new-name>: Renames the branch you are currently on to the new name.

4. Integrating Changes (Merging)

Once your work on a feature branch is finished and tested, you bring it back to the main code.

  • git merge <name>: Combines the history and changes of the specified branch into your current branch.

    Note: Usually, you switch to main first and then run git merge feature-branch.

5. Cleaning Up (Deleting)

To keep your project tidy, you should delete branches after they have been merged.

  • git branch -d <name>: Deletes the branch only if it has already been merged into your current branch (Safe delete).

  • git branch -D <name>: Force deletes the branch even if the changes aren't merged yet (Use with caution!).

6. Syncing with the Server (Remote)

These commands share your local branches with others or delete them from the server.

  • git push origin <name>: Uploads your local branch to the remote repository (GitHub).

  • git push origin --delete <name>: Deletes the branch from the remote server.


Summary Table

StepCommandWhat it does
1. Viewgit branchShows all local branches.
2. Create & Gogit switch -c <name>Creates a new branch and enters it.
3. Renamegit branch -m <new-name>Changes the name of the current branch.
4. Switchgit switch <name>Switches to an existing branch.
5. Combinegit merge <name>Merges changes into the current branch.
6. Deletegit branch -d <name>Removes a local branch after merging.
7. Pushgit push origin <name>Sends your branch to the online server.


--------------

Gitలో Branching (బ్రాంచింగ్) అంటే మీ ప్రాజెక్ట్‌కి ఒక సమాంతర వెర్షన్‌ను (Parallel version) సృష్టించడం. అంటే, అసలైన కోడ్ (Main code) ఏమాత్రం పాడవకుండా, మీరు కొత్త మార్పులను ఒక విడి భాగంలో చేసుకునే వెసులుబాటు ఇది.

దీన్ని ఒక చెట్టులా ఊహించుకోండి: Main branch అనేది చెట్టు కాండం (Trunk) లాంటిది. మీరు ఏదైనా కొత్త ఫీచర్ యాడ్ చేయాలనుకున్నప్పుడు ఒక కొమ్మ (Branch) లాగా విడిపోయి పని చేస్తారు. ఆ పని పూర్తయ్యాక, ఆ కొమ్మను తిరిగి కాండంతో కలిపేస్తారు (Merge).


ఉదాహరణ 1: కొత్త ఫీచర్ యాడ్ చేయడం (Creating a New Feature)

మీరు ఒక వెబ్‌సైట్ తయారు చేస్తున్నారు అనుకుందాం. ఇప్పుడు దానికి "Contact Us" అనే కొత్త పేజీని చేర్చాలి.

  1. కొత్త బ్రాంచ్: మీరు add-contact-page అనే పేరుతో ఒక బ్రాంచ్ క్రియేట్ చేస్తారు.

  2. విడిగా పని చేయడం: మీరు మీ కోడింగ్ అంతా ఈ కొత్త బ్రాంచ్‌లోనే చేస్తారు. దీనివల్ల మెయిన్ వెబ్‌సైట్ (Main branch) కి ఎటువంటి ఇబ్బంది ఉండదు. అది ఎప్పటిలాగే పని చేస్తూ ఉంటుంది.

  3. కలపడం (Merge): మీ పని పర్ఫెక్ట్‌గా ఉందని నిర్ధారించుకున్నాక, ఈ బ్రాంచ్‌ను main బ్రాంచ్‌లో కలిపేస్తారు. ఇప్పుడు మీ వెబ్‌సైట్‌లో కొత్త పేజీ కనిపిస్తుంది.

ఉదాహరణ 2: అర్జెంట్ బగ్ ఫిక్స్ (Hotfix for a Bug)

మీ వెబ్‌సైట్ లైవ్‌లో ఉంది, కానీ హఠాత్తుగా "Sign Up" బటన్ పని చేయడం లేదని తెలిసింది. మీరు అప్పటికే వేరే పెద్ద ప్రాజెక్ట్ పనిలో బిజీగా ఉన్నారు.

  1. మెయిన్ బ్రాంచ్‌కి మారడం: మీరు చేస్తున్న పనిని ఆపి, వెంటనే స్థిరంగా ఉన్న main బ్రాంచ్‌కి వెళ్తారు.

  2. బగ్ ఫిక్స్ బ్రాంచ్: వెంటనే fix-signup-button అనే ఒక చిన్న బ్రాంచ్ క్రియేట్ చేస్తారు.

  3. రిపేర్ & డిప్లాయ్: ఆ బటన్‌ను ఫిక్స్ చేసి, వెంటనే దాన్ని main బ్రాంచ్‌లో కలిపేస్తారు. తద్వారా లైవ్ వెబ్‌సైట్ సెట్ అయిపోతుంది.

  4. పాత పనిలోకి: ఇప్పుడు మళ్ళీ మీరు ఆగిపోయిన మీ పాత ప్రాజెక్ట్ బ్రాంచ్‌లోకి వెళ్లి పని కొనసాగించవచ్చు.


ముఖ్యమైన కమాండ్స్ (Core Commands)

  • git branch <name>: కొత్త బ్రాంచ్ సృష్టించడానికి.

  • git checkout <name> (లేదా git switch <name>): ఒక బ్రాంచ్ నుండి ఇంకో బ్రాంచ్‌లోకి మారడానికి.

  • git merge <name>: ఒక బ్రాంచ్‌లో చేసిన మార్పులను ప్రస్తుత బ్రాంచ్‌లోకి కలపడానికి.

  • git branch: మీ ప్రాజెక్ట్‌లో ప్రస్తుతం ఎన్ని బ్రాంచ్‌లు ఉన్నాయో చూడటానికి.

Git బ్రాంచింగ్‌లో మీరు పని చేసే క్రమాన్ని బట్టి (Workflow), అన్ని ముఖ్యమైన కమాండ్లను ఇక్కడ ఒక పద్ధతిలో వివరిస్తున్నాను:

1. బ్రాంచ్‌ల స్థితిని తెలుసుకోవడం (Viewing)

ఏదైనా చేసే ముందు, అసలు ఏ బ్రాంచ్‌లు ఉన్నాయో చూసుకోవాలి.

  • git branch: లోకల్ బ్రాంచ్‌ల లిస్ట్ చూపిస్తుంది. (మీరు ఉన్న బ్రాంచ్ పక్కన * ఉంటుంది).

  • git branch -v: ప్రతి బ్రాంచ్‌లో చివరగా చేసిన కమిట్ (Last commit) వివరాలను చూపిస్తుంది.

2. కొత్త బ్రాంచ్ సృష్టించడం మరియు మారడం (Creating & Switching)

పని ప్రారంభించేటప్పుడు వాడే కమాండ్స్ ఇవి.

  • git branch <name>: కొత్త బ్రాంచ్‌ని క్రియేట్ చేస్తుంది.

  • git switch <name>: ఒక బ్రాంచ్ నుండి ఇంకో బ్రాంచ్‌లోకి మారుస్తుంది.

  • git switch -c <name>: (ముఖ్యమైనది) కొత్త బ్రాంచ్‌ని సృష్టించి, వెంటనే అందులోకి మారుస్తుంది (ఇది git checkout -b కి సమానం).

3. పేరు మార్చడం (Renaming)

  • git branch -m <new-name>: ప్రస్తుతం మీరు ఉన్న బ్రాంచ్ పేరును మార్చడానికి.

4. మార్పులను కలపడం (Merging)

మీ కొత్త ఫీచర్ పని పూర్తయిన తర్వాత, దాన్ని మెయిన్ కోడ్‌లో కలపడానికి.

  • git merge <branch-name>: వేరే బ్రాంచ్‌లోని మార్పులను మీరు ప్రస్తుతం ఉన్న బ్రాంచ్‌లోకి తెస్తుంది.

5. డిలీట్ చేయడం (Deleting)

పని పూర్తయి మెర్జ్ చేసిన తర్వాత, అనవసరమైన బ్రాంచ్‌లను తొలగించడానికి.

  • git branch -d <name>: బ్రాంచ్‌ని డిలీట్ చేస్తుంది (ఒకవేళ అది మెర్జ్ అయి ఉంటేనే).

  • git branch -D <name>: మెర్జ్ అవ్వకపోయినా సరే, బలవంతంగా డిలీట్ చేస్తుంది.

6. రిమోట్ సర్వర్‌తో (GitHub/GitLab) పని చేయడం

  • git push origin <name>: మీ లోకల్ బ్రాంచ్‌ని రిమోట్ రిపోజిటరీకి పంపుతుంది.

  • git push origin --delete <name>: రిమోట్ సర్వర్‌లో ఉన్న బ్రాంచ్‌ను డిలీట్ చేస్తుంది.


ఒకే టేబుల్‌లో పూర్తి సారాంశం:

క్రమం (Order)కమాండ్ (Command)వివరణ (Simple Explanation)
1. Viewgit branchఉన్న బ్రాంచ్‌ల లిస్ట్ చూడటానికి.
2. Create & Switchgit switch -c <name>కొత్త బ్రాంచ్ సృష్టించి అందులోకి వెళ్లడానికి.
3. Renamegit branch -m <new-name>బ్రాంచ్ పేరు మార్చడానికి.
4. Check Outgit switch <name>వేరే బ్రాంచ్‌కి మారడానికి.
5. Combinegit merge <name>కోడ్‌ని కలపడానికి.
6. Clean upgit branch -d <name>పని అయిపోయిన బ్రాంచ్‌ను తీసేయడానికి.
7. Syncgit push origin <name>సర్వర్‌లోకి అప్‌లోడ్ చేయడానికి.