Git

Read 5 posts from Git

Posts

  • Revert a check-in file in Git

    To revert a file to a previous version in Git, follow these steps: This will display a concise list of commits that have modified the file. 2. Checkout the previous version of the file: Use the git checkout command followed by the commit hash and the file name: Replace <commit_hash> with the hash of the…

  • Git Rebase Interactive: A Step-by-Step Guide

    Git Rebase Interactive is a powerful tool for rewriting commit history. Here’s how to use it: Step 1: Rebase the Branch Step 2: Edit the Commit History Step 3: Save and Close Save and close the interactive shell. Git will rebase the branch according to your changes. Step 4: Push the Updated Branch Example Output…

  • Git clone repo with specific branch

    Git clone command clones the default or master repository from git remote source. If need to clone a specific branch, we need to specify the branch name in the git clone command. Here is the command to do so Or we can write the same command as follows Hope this helps. Happy Coding 🙂

  • Folder rename in Git

    Git can’t detect directory name change. For example rename an existing folder to “Dashboard” from “DashBoard”. Even if we rename the folder name from the directory but git will still not detect the change. Here is the git command to make it work for rename For the above example it will not work since it’s…

  • Create git repo from existing project

    Often I forget the commands to create git repo from existing project in my local machine. First step is to init a git repo in your project. Use git bash Second step to add the project files into local git repo Use the .(dot) after the add, this is saying add all files. This command…