GitHub Workflow: How to Work on a Real Project
GitHub Workflow is a systematic process used by developers professionals to manage real projects. It's not just about writing code, it's about thinking and planning enabling you to develop your project safely, and you can work with other people without running into each other.
What is the need for Workflow?
A real project is not one file or one page. There are many changes, bug fixes, and new features to be added. GitHub Workflow ensures that every change be documented, and understand why it was done.
Step 1: Creating Repository
The first step is to go to your project make it a Git repository. If it is a new project, you use git init, If it already exists, use it git clone. This will allow Git to start monitoring all changes.
Step 2: Use Branches
A real project is not only run on the main branch. Branch is a place where you can try a new idea without it compromise the main code. For example, you are creating a new feature for a branch until you are sure it is working properly.
- Main branch: The official code
- Feature branch: New
- Fix branch: Error to be corrected
Step 3: Commit & Push
Commit is an explanatory historical message you have changed. A good commit says a concise and clear message, which makes it easy for everyone to understand what happened. After you commit, you push it GitHub online.
Step 4: Pull Request & Merge
Pull Request is where to check the code. It can be viewed for errors, structure, and that it is compatible with the rest of the project. Once approved, the code is added the main branch.