Gangmax Blog

自由之思想,独立之精神

Git Log Command

| Comments

Some usefull “git log” commands.

From here.

1
2
3
4
5
6
7
8
# 1. Output git log with the first line only.
git log --pretty=oneline --abbrev-commit

# 2. Output the recent N log items.
git log -n 5

# Output log items in the given time period.
git log --pretty=oneline --abbrev-commit --after 2017-07-25 --before 2017-07-26

Fourth Docker Notes

| Comments

Batch remove Docker instances

From here.

1
2
3
4
# 1. Stop the Docker instances.
docker stop $(docker ps -aq)
# 2. Rmove the Docker instances.
docker rm $(docker ps -qa)

Batch remove Docker images

From here.

1
2
3
4
5
6
# 1. List the specific Docker images.
docker images |  grep "x86_64-1.0.0-beta"
# 2. Remove the specific Docker images. The column "3" is the image ID column.
docker images | grep "x86_64-1.0.0-beta" | awk '{print $3}' | xargs docker rmi
# 3. Remove all the Docker images.
docker rmi $(docker images -aq)