6 The Basic Git Workflow
Command: $ mkdir scripts $ cd scripts $ git init Code output: Initialized empty Git repository in /home/user/scripts/.git/ Command: $ git config -l Code output: user.email=artwalker@example.com ...
Command: $ mkdir scripts $ cd scripts $ git init Code output: Initialized empty Git repository in /home/user/scripts/.git/ Command: $ git config -l Code output: user.email=artwalker@example.com ...
Command: $ cat example_commit.txt Code output: Provide a good commit message example The purpose of this commit is to provide an example of a hand-crafted, artisanal commit message. The first l...
Study Guide: Git In any Git project, there are three sections: the Git directory, the working tree, and the staging area. This study guide provides some basic concepts and commands that can help ...
Terms and definitions Commit: A command to make edits to multiple files and treat that collection of edits as a single change Commit files: A stage where the changes made to files are safely stor...
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...