https://github.com/varunu28/git-saviors
Commands which help me to navigate around git
https://github.com/varunu28/git-saviors
git github
Last synced: about 1 month ago
JSON representation
Commands which help me to navigate around git
- Host: GitHub
- URL: https://github.com/varunu28/git-saviors
- Owner: varunu28
- Created: 2018-02-07T18:01:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-19T16:50:45.000Z (over 7 years ago)
- Last Synced: 2025-11-11T01:31:54.473Z (7 months ago)
- Topics: git, github
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-saviors
Commands which help me to navigate around git
#### Check the history log for git
```
git reflog
```
#### Set sublime(or your favorite text editor) as default text editor for editing commits
```
git config --global core.editor "subl -n -w"
```
#### Check the history log with timestamp
```
git reflog --date=iso
```
#### Undo a rebase/squash
```
git reset --hard HEAD@{N}
Replace N with the log number as shown in reflog
```
#### Shows a clear description of all the commits in a git repository
```
git log --pretty=oneline
```
#### Rebase to master and get the forked repo in sync from local
```
git pull --rebase main master
git push -f
```
#### Messed Up and want to revert the commit
```
git reset --soft HEAD^ (If you want to keep the changes on local)
git reset --hard HEAD^ (Messed up big time & don't care about the changes)
```
#### Maven commands (Specific to checkstyle project)
```
mvn -Passembly -Dmaven.test.skip=true package
mvn verify
```
#### Clone a particular branch
```
git clone --single-branch --branch
```