15 Amending commits
15 Amending commits
Command:
1
2
3
4
$ cd scripts/
$ touch auto-update.py
$ touch gather-information.sh
$ ls -l
Code output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
total 8
-rwxrwxr-x 1 user user 319 Jul 16 17:56 all_checks.py
-rw-rw-r-- 1 user user 0 Jul 16 20:19 auto-update.py
-rw-rw-r-- 1 user user 0 Jul 16 20:19 gather-information.sh
-rw-rw-r-- 1 user user 15 Jul 16 18:03 output.txt
user@ubuntu:~/scripts$ git add auto-update.py
user@ubuntu:~/scripts$ git commit -m 'Add two new scripts'
[master 9c78761] Add two new scripts
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 auto-update.py
Command:
1
2
$ git add auto-update.py
$ git commit -m 'Add two new scripts'
Code output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Tue Jul 16 20:20:24 2019 +0200
#
# On branch master
# Changes to be committed:
# new file: auto-update.py
# new file: gather-information.sh
#
# Untracked files:
# output.txt
#
Command:
1
2
$ git add gather-information.sh
$ git commit --amend
Code output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Add two new scripts.
# Please enter the commit message for your changes. Line starting
#with '#' will be ignored, and an empty message aborts the commit.
#
#Date: Mon Jan 6 08:28:17 2020 -0800
#
# On branch master
# Changes to be committed:
# new file: auto-update.py
# new file: gather-information.sh
#
# Untracked files:
# output.txt
Modify commit message:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Add two new scripts.
gather-information.sh will collect information in case of errors.
auto-update.py will run daily to update computers automatically.
# Please enter the commit message for your changes. Line starting
#with '#' will be ignored, and an empty message aborts the commit.
#
#Date: Mon Jan 6 08:28:17 2020 -0800
#
# On branch master
# Changes to be committed:
# new file: auto-update.py
# new file: gather-information.sh
#
# Untracked files:
# output.txt
This post is licensed under CC BY 4.0 by the author.