Tag Archives: GIT

GIT: Reset

Undoes all commits after <commit>, preserving changes locally: git reset [commit] Discards all history and changes back to the specified commit: git reset –hard [commit]  

GIT: Stashing

Sometimes we need to work on multiple tasks and switch branches as per need. In such cases, many times we need to switch to another branch while working on current branch with incomplete code. Here, stashing concept helps a lot. Lets discuss stashing helpful commands: If you have incomplete and non-committed code, then you can… Read More »

GIT: Change the local/pushed commit messages

Rewrite the most recent commit message: If the commit exists in your local repository only and has not been pushed yet to remote repository, you can amend the commit message with the command: git commit –amend -m “New commit message” NOTE: Make sure you don’t have any working copy changes staged before doing this otherwise… Read More »

Git: Changing a commit message

Hi Friends, Here, we will see how we can change the commit messages based on various situation ions. Rewriting the most recent commit message and commit has not been pushed online git commit –amend and edit the message in opened editor and save git commit –amend -m “New commit message” git log: check the updated… Read More »

Git – Review Changes

Hi Friends, Here we see some main git commands which will help up in review the changes. git status: git-status – Show the working tree status. Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in… Read More »

GIT: Step by step git rebase

Hi friends, Here are the steps that you need to follow in order to rebase a branch with base branch: git checkout <base-branch> git fetch origin git pull /* In order to pull latest changes */ git checkout <my-branch> git pull –rebase origin <base-branch> Case I: If no issue comes, then git push –force -u… Read More »