🔧 Creating & Cloning Repositories – Mastering Your Version Control Workflow As a developer, your code is only as strong as the system that manages it. Whether you’re building solo projects or collaborating with a team, Git is your best friend for tracking changes, versioning, and working safely. Let’s make it practical 👇 ✅ 1️⃣ Creating a Repository 💡 You’re starting a new project called “portfolio-site”. # Step 1: Create a new folder mkdir portfolio-site cd portfolio-site # Step 2: Initialize Git locally git init # Step 3: Create your first file echo "My Portfolio Website" > README.md # Step 4: Add and commit changes git add . git commit -m "Initial commit - setup project" # Step 5: Connect to GitHub (after creating a repo online) git remote add origin https://lnkd.in/g9kZFkp3 # Step 6: Push your code to GitHub git push -u origin main ✅ Now your project is live on GitHub! 🎉 ✅ 2️⃣ Cloning a Repository 💡 You want to work on an existing repo called “todo-app”. # Step 1: Clone it from GitHub git clone https://lnkd.in/giaKkhAg # Step 2: Move into the folder cd todo-app # Step 3: Check remote info git remote -v # Step 4: Create a new branch for your work git checkout -b feature/add-login # Step 5: After making changes git add . git commit -m "Added user login feature" # Step 6: Push your branch to GitHub git push origin feature/add-login ✅ Now your work is backed up and ready for review or a pull request! 🚀 💡 Why This Matters You have a complete history of every change. Collaboration becomes smoother — no lost files or overwrites. You can experiment safely using branches. It builds your credibility as a professional developer. 🎯 Best Practices Always include a clear README.md explaining your project. Add a .gitignore to exclude unnecessary files (e.g., node_modules, .env). Use meaningful commit messages: ✅ “Add login validation” ❌ “Fixed stuff” Regularly pull and push code to stay synced with your team. 💬 Pro Tip: If you want to contribute to open-source projects: Fork the repository Clone your fork Create a branch Make changes Submit a Pull Request 🔁 🚀 Ready to level up your version control workflow? Master these commands and you’ll never fear losing your code again! #Git #GitHub #VersionControl #SoftwareDevelopment #CodingBestPractices #DeveloperTools #OpenSource #Collaboration
Prathap kunarapu’s Post
More Relevant Posts
-
Git & GitHub Interview Questions & Answers 🧑💻🌐 1. What is Git? Git is a distributed version control system to track changes in source code during development. 2. What is GitHub? GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD. 3. Git vs GitHub Git: Version control tool (local) GitHub: Hosting service for Git repositories (cloud-based) 4. What is a Repository (Repo)? A storage space where your project’s files and history are saved. 5. Common Git Commands git init → Initialize a repo git clone → Copy a repo git add → Stage changes git commit → Save changes git push → Upload to remote git pull → Fetch and merge from remote git status → Check current state git log → View commit history 6. What is a Commit? A snapshot of your changes. Each commit has a unique ID (hash) and message. 7. What is a Branch? A separate line of development. The default branch is usually main or master. 8. What is Merging? Combining changes from one branch into another. 9. What is a Pull Request (PR)? A GitHub feature to propose changes, request reviews, and merge code into the main branch. 10. What is Forking? A: Creating a personal copy of someone else’s repo to make changes independently. 11. What is .gitignore? A file that tells Git which files/folders to ignore (e.g., logs, temp files, env variables). 12. What is Staging Area? A space where changes are held before committing. 13. Difference between Merge and Rebase Merge: Keeps all history, creates a merge commit Rebase: Rewrites history, makes it linear 14. What is Git Workflow? A set of rules like Git Flow, GitHub Flow, etc., for how teams manage branches and releases. 15. How to Resolve Merge Conflicts? Manually edit the conflicted files, mark resolved, then commit the changes. 16. What is a Tag in Git? A tag marks a specific point in history, often used for releases (e.g., v1.0). 17. Difference between Soft, Mixed, and Hard Reset? git reset --soft → Moves HEAD, keeps changes staged git reset --mixed (default) → Moves HEAD, unstages changes git reset --hard → Removes all changes 18. What is Git Revert? A: Reverts a commit by creating a new one that undoes changes, keeping history intact. 19. What is Cherry Pick? Apply a specific commit from one branch to another without merging the whole branch. 20. What is Git Stash? Temporarily saves uncommitted changes so you can switch branches safely. 21. What is HEAD in Git? A pointer to the current branch reference or latest commit in your working directory. 22. Difference between origin and upstream origin: Default remote repo you cloned from upstream: Original repo you forked from 23. What is Fast-forward Merge? When no divergence, Git just moves the branch pointer forward — no new commit needed. 24. Git Fetch vs Git Pull Fetch: Downloads changes without merging Pull: Fetch + Merge in one step Develop your coding skill JavaScript Mastery #Git #GitHub #InterviewPre #TechSkills
To view or add a comment, sign in
-
-
🚀 12 Most Common Git Commands Every Developer Should Know 💡 Whether you're a beginner or a pro, Git is the backbone of modern version control. Here's a quick guide to the most essential Git commands you’ll use almost daily. 🧠💻 🔧 1. git init Purpose: Initializes a new Git repository in your current directory. 📥 2. git clone Purpose: Creates a copy of an existing repository on your local machine. ➕ 3. git add Purpose: Stages changes in your working directory for the next commit. 📝 4. git commit Purpose: Commits staged changes to the repository with a descriptive message. 🔍 5. git status Purpose: Displays the status of changes—what's staged, modified, or untracked. 📤 6. git push Purpose: Pushes your commits to a remote repository like GitHub. 🔄 7. git pull Purpose: Fetches and merges updates from a remote repository into your local branch. 🌿 8. git branch Purpose: Lists, creates, or deletes branches within your project. 🔁 9. git checkout Purpose: Switches between branches or restores files in your working directory. 🔀 10. git merge Purpose: Merges changes from one branch into another. 📚 11. git log Purpose: Displays the history of commits in your repository. 📎 12. git diff Purpose: Shows changes between commits, branches, or your working directory. ⚡ Bonus Git Commands Every Power User Should Know: 🛰️ git fetch – Retrieve updates from a remote repository without merging. 🔁 git rebase – Reapply commits on top of another base commit. ⏪ git reset – Undo changes or move the HEAD pointer. 🧳 git stash – Temporarily store uncommitted changes. 🏷️ git tag – Mark specific points in history (e.g., for releases). 🌐 git remote – Manage connections to remote repositories. 🔎 git show – Display details about a specific commit. ♻️ git revert – Create a new commit that undoes a previous one. 🕵️ git blame – See who last modified each line of a file. 🍒 git cherry-pick – Apply specific commits from another branch. 🧹 git rm – Remove files from the working directory and staging area. 📦 git archive – Create a .zip or .tar file of your repository. 🔗 Stay sharp, stay version-controlled! Drop your favorite Git command below or tag someone who should see this! 👇👇 hashtag #Git #VersionControl #GitCommands #DevTools #Programming #SoftwareDevelopment #100DaysOfCode #GitTips #LinkedInTech #WebDevelopment #OpenSource #DeveloperTools
To view or add a comment, sign in
-
-
Time for a quick git revision! A review for beginners and a quick lookup for pros. Here are the most common, basic Git commands. Configuration Set up your user information for all local repositories. 'git config --global user.name "[Your Name]" ': Sets the name you want attached to your commits. 'git config --global user.email "[your_email@example.com]"': Sets the email you want attached to your commits. Starting a Project Initialize a new repository or clone an existing one. 'git init': Turns the current directory into a new Git repository. 'git clone [url]': Downloads a project and its entire version history from a remote URL (like GitHub). Making Changes (Local) Save your work locally. 'git status': Shows the status of changes: files that are staged, unstaged, and untracked. 'git add [file.txt]': Adds a specific file to the staging area (prepares it for a commit). 'git add . ':Adds all new and modified files in the current directory to the staging area. 'git commit -m "[Your commit message]"': Saves the staged files as a new snapshot in the project's history. The message describes the changes. Viewing History Inspect what has happened in the repository. 'git log': Shows a list of all commits in the repository's history, starting with the most recent. 'git log --oneline': Shows a condensed, one-line view of the "commit history. git diff Shows the differences between your working directory and the last commit (changes that are not yet staged). 'git diff --staged': Shows the differences between your staged files and the last commit. Branching & Merging Work on different features or fixes in isolation. 'git branch': Lists all branches in your local repository. 'git branch [branch-name]': Creates a new branch. 'git checkout [branch-name]': Switches your working directory to the specified branch. 'git checkout -b [new-branch-name]': A shortcut that creates a new branch and switches to it immediately. 'git merge [branch-name]': Combines the history of the specified branch into your current branch. 'git branch -d [branch-name]': Deletes the specified branch (only if it has been merged). Working with Remotes Sync your local repository with a remote one (like GitHub). 'git remote -v': Lists all remote repositories you have configured (shows their URLs). 'git remote add [name] [url]': Adds a new remote repository (e.g., git remote add origin [url]). 'git fetch [remote-name]': Downloads all history from the remote repository but doesn't merge it into your local branch. 'git pull [remote-name] [branch-name]': Fetches changes from the remote and merges them into your current local branch (equivalent to git fetch followed by git merge). 'git push [remote-name] [branch-name]': Uploads your local branch's commits to the remote repository. Hope this helps! What's your most-used Git command? 👇 #git #github #developer #coding #programming #cheatsheet #devops #gitrevision #versioncontrol #developer #softwareengineering #coding
To view or add a comment, sign in
-
-
✅ *Git & GitHub Interview Questions & Answers* 🧑💻🌐 *1️⃣ What is Git?* *A:* Git is a distributed version control system to track changes in source code during development. *2️⃣ What is GitHub?* *A:* GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD. *3️⃣ Git vs GitHub* - *Git:* Version control tool (local) - *GitHub:* Hosting service for Git repositories (cloud-based) *4️⃣ What is a Repository (Repo)?* *A:* A storage space where your project’s files and history are saved. *5️⃣ Common Git Commands:* - `git init` → Initialize a repo - `git clone` → Copy a repo - `git add` → Stage changes - `git commit` → Save changes - `git push` → Upload to remote - `git pull` → Fetch and merge from remote - `git status` → Check current state - `git log` → View commit history *6️⃣ What is a Commit?* *A:* A snapshot of your changes. Each commit has a unique ID (hash) and message. *7️⃣ What is a Branch?* *A:* A separate line of development. The default branch is usually `main` or `master`. *8️⃣ What is Merging?* *A:* Combining changes from one branch into another. *9️⃣ What is a Pull Request (PR)?* *A:* A GitHub feature to propose changes, request reviews, and merge code into the main branch. *🔟 What is Forking?* *A:* Creating a personal copy of someone else’s repo to make changes independently. *1️⃣1️⃣ What is .gitignore?* *A:* A file that tells Git which files/folders to ignore (e.g., logs, temp files, env variables). *1️⃣2️⃣ What is Staging Area?* *A:* A space where changes are held before committing. *1️⃣3️⃣ Difference between Merge and Rebase* - *Merge:* Keeps all history, creates a merge commit - *Rebase:* Rewrites history, makes it linear *1️⃣4️⃣ What is Git Workflow?* *A:* A set of rules like Git Flow, GitHub Flow, etc., for how teams manage branches and releases. *1️⃣5️⃣ How to Resolve Merge Conflicts?* *A:* Manually edit the conflicted files, mark resolved, then commit the changes.
To view or add a comment, sign in
-
🚀 Master Git Like a Pro: Essential Commands Every Developer Should Know! Whether you're just starting your coding journey or working on production-grade systems, this Git cheat sheet covers the most important commands to boost your productivity and streamline your workflow. Save it, share it, and level up your version control game! 💡 🔥 General Git Tools 🔹 git init → Start a new repository 🔹 git clone <repo> → Download a remote project to your machine 🔹 git status → Check modified, staged & untracked files 🔹 git log → View commit history 🔹 git branch → List all branches 🔹 git checkout <branch> → Switch branches 🔹 git merge <branch> → Merge changes into the current branch 🔹 git stash / git stash pop → Save & restore uncommitted changes 🛠️ Staging & Commit Commands 🔹 git add <file> → Stage a specific file 🔹 git add . → Stage everything 🔹 git commit -m "message" → Save changes with a message 🔹 git push → Upload commits to remote 🔹 git pull → Fetch + merge updates 📊 Info & Debugging 🔹 git diff → View unstaged changes 🔹 git diff --staged → View staged changes 🔹 git show → Display commit details 🔹 git blame <file> → See who changed each line 🔹 git tag → List or create version tags 🌍 Remote Repository Commands 🔹 git remote -v → Show remote URLs 🔹 git remote add origin <url> → Add a remote repo 🔹 git push -u origin <branch> → Push code & set upstream 🔹 git fetch → Download updates without merging 🌱 Branching Commands 🔹 git branch <name> → Create a new branch 🔹 git checkout -b <name> → Create + switch branch 🔹 git switch <branch> → Switch branches 🔹 git branch -d <branch> → Delete a branch 🔹 git merge <branch> → Merge into current branch 🧹 Cleanup & Maintenance 🔹 git clean -f → Remove untracked files 🔹 git gc → Optimize repository 🔹 git fsck → Check repo integrity 🗂 Stash Management 🔹 git stash list → Show all stashes 🔹 git stash apply → Apply a stash safely 🔹 git stash pop → Apply & delete stash 🔹 git stash drop → Remove a stash 🔖 Save this for later. 💬 Comment your favorite Git command. 🔁 Share to help fellow developers master Git more easily. Let’s build smarter, collaborate better, and ship faster! 💙 #Git #GitCommands #GitTutorial #VersionControl #GitHub #Developers #SoftwareDevelopment #Programming #Coding #DeveloperTools #DevTips #CodeNewbie #GitWorkflow #TechTips #CodingTips #OpenSource #DevCommunity #SoftwareEngineer #WebDevelopment #MobileDevelopment #Flutter #AndroidDev #ReactNative #Kotlin #JavaScript #CleanCode #Debugging #BuildInPublic #TechCommunity #Engineering #100DaysOfCode #Automation #CodeLife #GitForBeginners #TechLearning #ProgrammingLife #CodeJourney #DeveloperLife #StackOverflow #LearningInPublic #SoftwareEngineering #CodeTips #GitBasics #DevOps #CloudDevelopers #ProductivityTools #GitMerge #GitPush #GitAdd #CommitYourCode
To view or add a comment, sign in
-
-
🚀 Cheat Sheet: Git Survival Guide — Master the Art of Version Control! Ever found yourself tangled in Git branches, merge conflicts, or lost commits? You’re not alone. 😅 Every developer has faced the chaos at some point — but the good news is: Git is predictable once you understand its logic. Let’s dive into the Git Survival Guide — a mix of theory, must-know commands, and practical wisdom 🧠 🧠 The Theory — What Git Really Is Git isn’t just a tool for saving versions — it’s a content-addressable version database. Every change (commit) creates a snapshot of your project and stores it as a commit object identified by a unique hash (SHA-1). These snapshots are linked like a chain, forming your project’s history. Branches are just pointers to specific commits — making Git lightweight and fast. Understanding this makes commands like reset, revert, and rebase much less scary! 🧩 Core Git Workflow Here’s the simplest mental model: Working Directory → Staging Area → Repository You modify files in your working directory, stage them using git add, and commit them to your repository with git commit. From there, you push changes to remote repos or pull updates from teammates. ✅ Best Practices 🧩 Commit often, commit small. One logical change = one commit. 🧠 Use meaningful commit messages. Example: “Fix login timeout issue” > “update code”. 🧹 Don’t commit secrets or binaries. Add them to .gitignore. 🔒 Protect your main/master branch. Require PR reviews & approvals. 🚧 Use feature branches for new work — avoid coding directly on main. ⏱️ Rebase before merge for a clean, linear history. 💬 Review diffs before committing. Always check with git diff --cached. 💡 Pro Tips & Tricks git log -p → View code differences in commit history git reflog → Recover lost commits (lifesaver!) git cherry-pick <hash> → Apply a specific commit from another branch git blame <file> → Find who modified a line git bisect → Binary search to find which commit broke something git diff --color-words → Perfect for reviewing text/documentation changes git alias → Create short custom commands (e.g., git lg for log graph) 🧭 Mental Model to Survive Git Think of Git as a timeline of snapshots. Every action (add, commit, push) just moves or copies your project pointer. Nothing truly “disappears” — Git remembers everything. 🔍 ✨ Final Thoughts Mastering Git is not about memorizing commands — it’s about understanding what happens under the hood. Once you do, Git becomes your best teammate — not your worst nightmare. 💪 💬 What’s your favorite Git trick or a command that saved your day? Drop it in the comments! 👇 🔖 Save this post — it’s your go-to Git Survival Guide! Cheat sheet: Git survival guide: https://lnkd.in/eVtd3kcd #Git #DevOps #VersionControl #GitTips #SoftwareEngineering #Coding #CareerGrowth #GitCheatSheet #GitCommands
To view or add a comment, sign in
-
✅ *Git & GitHub Interview Questions & Answers* 🧑💻🌐 *1️⃣ What is Git?* *A:* Git is a distributed version control system to track changes in source code during development.*2️⃣ What is GitHub?* *A:* GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD.*3️⃣ Git vs GitHub* - *Git:* Version control tool (local) - *GitHub:* Hosting service for Git repositories (cloud-based) *4️⃣ What is a Repository (Repo)?* *A:* A storage space where your project’s files and history are saved.*5️⃣ Common Git Commands:* - `git init` → Initialize a repo - `git clone` → Copy a repo - `git add` → Stage changes - `git commit` → Save changes - `git push` → Upload to remote - `git pull` → Fetch and merge from remote - `git status` → Check current state - `git log` → View commit history *6️⃣ What is a Commit?* *A:* A snapshot of your changes. Each commit has a unique ID (hash) and message.*7️⃣ What is a Branch?* *A:* A separate line of development. The default branch is usually `main` or `master`.*8️⃣ What is Merging?* *A:* Combining changes from one branch into another.*9️⃣ What is a Pull Request (PR)?**A:* A GitHub feature to propose changes, request reviews, and merge code into the main branch.*🔟 What is Forking?* *A:* Creating a personal copy of someone else’s repo to make changes independently.*1️⃣1️⃣ What is .gitignore?* *A:* A file that tells Git which files/folders to ignore (e.g., logs, temp files, env variables).*1️⃣2️⃣ What is Staging Area?* *A:* A space where changes are held before committing.*1️⃣3️⃣ Difference between Merge and Rebase* - *Merge:* Keeps all history, creates a merge commit - *Rebase:* Rewrites history, makes it linear *1️⃣4️⃣ What is Git Workflow?* *A:* A set of rules like Git Flow, GitHub Flow, etc., for how teams manage branches and releases.*1️⃣5️⃣ How to Resolve Merge Conflicts?* *A:* Manually edit the conflicted files, mark resolved, then commit the changes. #ssekabirarobertsims💬 *like if you found this useful!*
To view or add a comment, sign in
-
-
🧩 Core Git & GitHub Concepts 1. Repository (Repo) A repository is a project folder that Git tracks It contains all your files plus a hidden `.git` folder that stores the project’s history. Example: You start a website project — that folder (`my-website/`) becomes your repo. 💬 Analogy: A repo = a *binder* with all versions of your project inside. --- 2. Commit A commit is like saving a snapshot of your project at a specific point in time. It includes what changed, who made the change, and when. 💻 Command example: ```bash git commit -m "Added navigation bar" ``` 💬 Analogy: A commit = taking a *photo* of your project before making new edits. --- 3. Branch A branch is a separate line of development. You can experiment or add features without affecting the main code. 💻 Example: `main` (or `master`) is your stable branch. You create a new branch for a feature: ```bash git checkout -b feature/login ``` 💬 Analogy: A branch = a *parallel timeline* in your project’s history. --- 4. Merge When your work on a branch is ready, you **merge** it back into the main branch. 💻 **Example:** ```bash git merge feature/login ``` 💬 **Analogy:** Merging = bringing together two timelines into one. --- 5. **Clone** * To **clone** a repo means to make a local copy of it from GitHub (or another source). 💻 **Example:** ```bash git clone https://lnkd.in/dWYs6eXG ``` 💬 **Analogy:** Cloning = downloading the entire project *and its history*. --- 6. **Push** * **Push** = sending your local commits to GitHub (uploading changes). 💻 **Example:** ```bash git push origin main ``` 💬 **Analogy:** Push = “upload my new work to the shared folder.” --- 7. **Pull** * **Pull** = getting the latest changes from GitHub to your local computer. 💻 **Example:** ```bash git pull origin main ``` 💬 **Analogy:** Pull = “download the latest updates others made.” --- 8. **Remote** * A **remote** is the online version of your repo (e.g., on GitHub). 💻 **Example:** ```bash git remote add origin https://lnkd.in/dWYs6eXG ``` 💬 **Analogy:** Remote = the “cloud” version of your binder. --- 9. **Fork** * **Forking** means making your own *copy* of someone else’s GitHub repo so you can modify it freely. 💬 **Analogy:** Fork = “copy someone’s recipe book to try your own variations.” --- 10. **Pull Request (PR)** * A **pull request** is how you ask to merge your changes (from your branch or fork) into another repo. * Used in teamwork and open source projects. 💬 **Analogy:** PR = “Hey, I’ve improved this — can you review and add it to the main project?”
To view or add a comment, sign in
-
✅ Git & GitHub Interview Questions & Answers🧑💻🌐 1️⃣ What is Git? A: Git is a distributed version control system to track changes in source code during development. 2️⃣ What is GitHub? A:GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD. 3️⃣ Git vs GitHub - Git: Version control tool (local) - GitHub: Hosting service for Git repositories (cloud-based) 4️⃣ What is a Repository (Repo)? A: A storage space where your project’s files and history are saved. 5️⃣ Common Git Commands: - `git init` → Initialize a repo - `git clone` → Copy a repo - `git add` → Stage changes - `git commit` → Save changes - `git push` → Upload to remote - `git pull` → Fetch and merge from remote - `git status` → Check current state - `git log` → View commit history 6️⃣ What is a Commit? A: A snapshot of your changes. Each commit has a unique ID (hash) and message. 7️⃣ What is a Branch? A: A separate line of development. The default branch is usually `main` or `master`. 8️⃣ What is Merging? A: Combining changes from one branch into another. 9️⃣ What is a Pull Request (PR)? A: A GitHub feature to propose changes, request reviews, and merge code into the main branch. 🔟 What is Forking? A: Creating a personal copy of someone else’s repo to make changes independently. 1️⃣1️⃣ What is .gitignore? A: A file that tells Git which files/folders to ignore (e.g., logs, temp files, env variables). 1️⃣2️⃣ What is Staging Area? A: A space where changes are held before committing. 1️⃣3️⃣ Difference between Merge and Rebase* - Merge:Keeps all history, creates a merge commit - Rebase: Rewrites history, makes it linear 1️⃣4️⃣ What is Git Workflow? A:A set of rules like Git Flow, GitHub Flow, etc., for how teams manage branches and releases. 1️⃣5️⃣ How to Resolve Merge Conflicts? A: Manually edit the conflicted files, mark resolved, then commit the changes. 💬 Tap ❤️ if you found this useful!
To view or add a comment, sign in
-
# Git Workflow -- How Teams Collaborate Efficiently # Git is the backbone of modern development. Whether you're working solo or in a team, understanding the correct workflow prevents conflicts, keeps the codebase clean, and improves productivity. 1. Developers Clone the Repository Both team members (Sina & Ava) start by copying the project from the server: git clone <repo-url> 2. Make Changes Locally Each developer works on their own machine, modifies files, and saves changes using: git commit -m "message" 3. Push Changes to the Server After committing, they send updates to the shared server: git push This makes their changes available to the entire team. 4. Fetch the Latest Changes Before continuing work, developers pull or fetch the latest updates to stay in sync: git fetch (or simply git pull) This prevents merge conflicts later. 5. Merge Updates Developers merge changes locally or through a Pull Request workflow: git merge This combines everyone's work into one clean version. Commit → Push → Fetch → Merge This loop keeps the entire team aligned and the codebase updated. # Git Commands Cheat Sheet (Most Useful Commands) 1. Setup & Configuration git config --global user.name "Your Name" git config --global user.email "your@email.com" git config --list 2. Create & Clone Repositories git init # Initialize a new repo git clone <url> # Clone a remote repo git clone -b <branch> <url> 3. Checking Status & History git status git log git log --oneline git log --graph --decorate --oneline git show <commit> 4. Staging & Commit git add <file> git add . git commit -m "message" git commit -am "message" git restore <file> git restore --staged <file> 5. Branching git branch git branch <name> git branch -d <name> # delete branch git branch -D <name> # force delete git checkout <branch> git checkout -b <branch> # create + switch 6. Switching Branches (New Command) git switch <branch> git switch -c <branch> # create + switch 7. Merging git merge <branch> git merge --abort 8. Pull, Push & Fetch git pull # fetch + merge git fetch # get latest changes git push git push -u origin <branch> 9. Remote Repositories git remote -v git remote add origin <url> git remote remove origin git remote set-url origin <url> 10. Undoing Changes git reset <file> git reset --hard # reset everything git reset --soft <commit> git reset --mixed <commit> git revert <commit> 11. Clean Up git clean -n # preview delete git clean -f # force delete untracked files 12. Compare Changes git diff git diff <branch1> <branch2> git diff --staged #Git #VersionControl #Collaboration #SoftwareEngineering #CleanCode #DeveloperLife #CodingStandards #DevOps #DotNetDeveloper #TechCommunity
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development