Chapter 14 Git Workflow
Git
and GitHub
combine to facilitate a workflow for file transfer. This process works well for deploying Web Applications on AWS.
14.1 Workflow
Git
and GitHub
facilitate a workflow for developing and deploying applications:
Application Development begins locally (Local Repository) on your computer. Changes are tracked with Git.
Code is pushed to GitHub, a Remote Repository designed for sharing version controlled files.
The remote repository can be cloned to an AWS EC2 Instance, which is a Host for the production application.
14.2 Definitions
GitHub
- An online community for storing and sharing version-controlled software files. Has Public and Private repositories.Repository
(repo) - A group of files that are version controlled bygit
. Every change made to any of the files is tracked and can be differenced from the working version and any previous version that was committed.Remote Repository
- A remote repository is one that is stored in a shared location typically on GitHub (or BitBucket, GitLab, Azure, etc).Local Repository
- The local repository is one that is stored on your computer or your EC2 Server.
commit
- Creates a checkpoint for version controlling your file. As you develop, you should commit often because committing creates a safety harness (rock climbing analogy). The more often you commit, the shorter your fall when you screw something up.push
andpull
- These actions are used to send files to (push
) and from (pull
) your remote repository.clone
- Used to setup a local repo from a remote repo. We do this commonly when setting up software on EC2 servers.branch
- Branches are used for creating prototype software (development version) without modifying the working (production version) until you are ready. Once ready, wemerge
thebranch
(development version) with themaster
(production version).
Have a question? Leave a comment.