•  ru
ShellHacks
Command-Line Tips and Tricks

git

  • Blog

Git – Revert to Specific Commit – Local & Pushed

Posted on Monday September 2nd, 2019Monday September 2nd, 2019by admin

In Git we can gracefully revert all changes to the specific commit without using the potentially dangerous git reset command. In this note i am showing how to undo local changes by making a rollback to the specific commit and how to revert a commit that has already been pushed to remote.

Read More
4 Comments
  • Blog

Git – Remove All Commits – Clear Git History (Local & Remote)

Posted on Friday August 23rd, 2019by admin

In this article i am showing how to clear Git history by removing all commits. You may need this if you want to delete sensitive data from the history of Git commits. After such cleanup you will have the latest version of your Git repository, but with the one commit only. Be aware that after […]

Read More
16 Comments
  • Blog

Git – Config Username & Password – Store Credentials

Posted on Friday July 19th, 2019Sunday October 13th, 2019by admin

To connect to a Git repository with authentication over HTTP(S), every time it needs to set a username and password. You can configure Git to remember a username and password by storing them in a remote URL or by using Git credential helper. In this article i am showing how to clone Git repository by […]

Read More
12 Comments
  • Blog

Git – Create New Branch

Posted on Thursday July 4th, 2019by admin

Instead of committing directly in local master branch, a good developer creates a new branch each time he starts working on a new bug or feature. To create a new branch there is a git branch command. Below i will show the examples of how to create a new local branch in Git from another […]

Read More
No comments yet
  • Blog

Git – Squash Commits: Merge All Commits in Branch Into One

Posted on Friday April 26th, 2019Friday October 2nd, 2020by admin

Each time you are working on a bug or a feature, you create a branch for it. Usually, while working in such temporary branches, you make multiply commits without bothering a lot about commit messages and simply comment the changes with something like “work in progress” or just “WIP”. Before merging such branch into master […]

Read More
No comments yet
  • Blog

Git – Checkout Previous Branch

Posted on Wednesday October 24th, 2018by admin

While working with Git, it’s very common to move back and forth between two branches. If you want to checkout the previous branch you was working on, there is no need to type the name of this branch each time. In this short note i’ll show the easy way to switch between two branches in […]

Read More
1 Comment
  • Blog

Git – Diff Between Branches

Posted on Tuesday October 23rd, 2018Wednesday October 24th, 2018by admin

When you are working with multiple branches in Git, it’s important to be able to compare them and contrast the differences. In this short note i will show how to compare two branches in Git using the git diff command. I will show how to git diff between any two branches, e.g. current branch and […]

Read More
4 Comments
  • Blog

Git – Diff Staged and Unstaged Files

Posted on Tuesday October 23rd, 2018Tuesday October 23rd, 2018by admin

While working with Git it is often required to check the changes between different areas. Probably everyone knows the git diff, that shows the changes between the Working Directory and the Staging Area (git diff unstaged). But it is also often needed to shows the changes between the Staging Area and the HEAD (git diff […]

Read More
3 Comments
  • Blog

Git – Create New Branch and Checkout – In One Command

Posted on Wednesday July 25th, 2018Thursday July 4th, 2019by admin

Each time you want to commit a bug or a feature, you need to create a branch for it. To create a new branch there is a git branch command. After you have created a branch, you need to switch in this branch using a git checkout command. But it is also possible to create […]

Read More
3 Comments
  • Blog

Git – Revert File to Previous Commit

Posted on Monday October 23rd, 2017Monday October 23rd, 2017by admin

Sometimes it happens that you make some changes to a file but later realize that it was a mistake and these changes have to be discarded. In Git you can revert the changes made to a file if you haven’t committed them yet, as well as you can revert a file to any previous commit. […]

Read More
9 Comments

Posts navigation

Older posts
Newer posts

Online Tools

  • Base64 Decode
  • Base64 Encode

Tags

access-control anonymity ansible apache archive artifactory aws bash boot cmd command-line curl dns docker encryption git java jenkins kubernetes linux mail mongodb mysql network nmap openssl oracle password pdf performance powershell prometheus proxy python rabbitmq raspberry pi redis ssh systemd telnet text-processing tor tsm windows yum
  • Twitter
  • RSS
Privacy
Copyright © 2011-2020 | www.ShellHacks.com