https://github.com/shivajivarma/git
https://github.com/shivajivarma/git
git
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/shivajivarma/git
- Owner: shivajivarma
- Created: 2017-02-11T07:19:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T07:08:25.000Z (almost 3 years ago)
- Last Synced: 2025-02-10T10:52:42.924Z (over 1 year ago)
- Topics: git
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git
## Configure mergetool
```bash
git config --global --add merge.tool kdiff3
git config --global --add mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add mergetool.kdiff3.trustExitCode false
git config --global --add diff.guitool kdiff3
git config --global --add difftool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add difftool.kdiff3.trustExitCode false
```
## Remember password for git
### Ubuntu
```bash
git config --global credential.helper cache
```
### Windows
```bash
git config --global credential.helper wincred
```
## Revert local commit without lossing changes
```bash
git reset --soft HEAD~1
```
## Delete local GIT branches that were deleted on remote repository
```bash
git fetch --all
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs git branch -d
```
__Note: You can use a capital “D” instead of “d” to force delete__
## Git checkout file from specific branch or commit
```bash
git checkout origin/master -- src\folder\file-name.js
```
## NPM version sign git tags
```bash
npm config set sign-git-tag true
npm version patch
```