10 Skipping the staging area
Command: $ vim all_checks.py File with code: #!/usr/bin/env python3 import os import sys def check_reboot(): """Returns True if the computer has a pending reboot.""" return os.path.exist...
Command: $ vim all_checks.py File with code: #!/usr/bin/env python3 import os import sys def check_reboot(): """Returns True if the computer has a pending reboot.""" return os.path.exist...
Command: $ git log -p Code output: commit 033f27a8196987d61c4fd42930f2148b23434a03 (HEAD -> master) Author: My name <artwalker@example.com> Date: Mon Jul 15 14:39:18 2023 +0200 C...
Command: $ cd checks/ $ ls -l Code output: total 8 -rw-rw-r-- 1 user user 659 Jul 9 19:28 disk_usage.py -rw-rw-r-- 1 user user 659 Jul 15 21:43 processes.py Command: $ git rm process.py Code ...
| Command | Explanation | | ——– | ——– | | git commit -a | automatically stages the files that have been locally modified. New files which have not been published yet are not affected. | | git log...
Command: $ cd scripts $ vim all_checks.py File with code: #!/usr/bin/env python3 import os import sys def main(): if check_reboot(): print("Pending Reboot.") sys.exit(1) ...
Command: $ cd scripts/ $ touch auto-update.py $ touch gather-information.sh $ ls -l Code output: total 8 -rwxrwxr-x 1 user user 319 Jul 16 17:56 all_checks.py -rw-rw-r-- 1 user user 0 Jul 16 2...
Command: $ cd scripts $ vim all_checks.py File with code: #!/usr/bin/env python3 import os import sys def check_reboot(): """Returns True if the computer has a pending reboot.""" retur...
Command: $ cd checks $ git log -1 Code output: commit abb063210c1f011b0d6470a4c5f1d8f672edd3ef (HEAD -> master) Author: artwalker <artwalker@example.com> Date: Mon Jul 15 22:20:45 202...
When writing and committing code, making mistakes is a common occurrence. Thankfully, there are multiple ways for you to revert or undo your mistakes. Take a look at the helpful commands below. co...
Command: $ cd checks/ $ git branch Code output: * master Command: $ git branch new-feature $ git branch Code output: * master New-feature Command: $ git checkout new-feature Code output: Sw...