Category Archives: Git

How to remove last N number of commits in git?

In this post, we will learn to remove the last N number of commits in git. Let’s say, you want to delete the last 2 commits from your git commit then you can use the following command: In the above command, 2 is the number of the last commits you want to remove. You can increase or decrease… Read More »

Git delete last commit from remote

When working within Git, sometimes we need to delete the commit message. The reason could be anything like we’ve committed wrong implementation or anything. So, to remove it from the remote repository we can follow the steps below: 1. Delete from local You can delete the last commit locally by using the following command. 2. Delete from remote… Read More »

Git – Edit last commit message

In this short post, we will learn to edit last commit message in git. We, software developers, are using at least one version control system like Git. We often commit our changes to it. To make it easy to see the history in the future we should always give a meaningful message while using the commit command. So,… Read More »

Change Git remote URL

To use Git and collaborate effectively we need to set/define the remote repository properly. Remote repositories are the versions of our project that are hosted either on the Internet or Intranet. While managing a remote repository, sometimes we may need to move from one location to another or there may be a need to change the repository address.… Read More »