Git
is a version control system that allows multiple people to work on a project at the same time without overwriting each other's changes.
It keeps track of all changes made to a project and allows you to backtrack if necessary.
It's an essential tool for any developer because it encourages collaboration and ensures that your project's history is well-documented and retrievable.
Commonly used Git commands include:
git init:
This command is used to start a new repository.
git clone:
This command is used to copy a repository from a remote source to your local machine.
git add:
This command is used to stage changes for a commit.
git commit:
This command is used to save your changes to the local repository.
git push:
This command is used to send your committed changes to a remote repository.
git pull:
This command is used to fetch changes from a remote repository and merge them into your current branch.
git status:
This command is used to show the status of changes as untracked, modified, or staged.
git branch:
This command is used to list, create, or delete.
branches gist.github.com.
CIDI stands for Continuous Integration and Continuous Delivery. It's a practice in software development where developers regularly merge their code changes into a central repository, after which automated builds and tests are run. The key goals are to find and address bugs quicker, improve software quality, and reduce the time it takes to validate and release new software updates.
Git Flow
is a branching model for Git, created by Vincent Driessen. It's a solution to the problem of maintaining a stable code base when multiple developers are working on a project at once.
In Git Flow, there are two main branches:
- main or master: This branch contains production code. All of the code that is currently in production is stored in this branch.
- develop: This is the branch to which all feature branches are merged, and where all tests are performed. Only when an update is considered ready for production, it is merged into the main branch docs.syntevo.com.
There are also three types of supporting branches:
- feature branches: These are used to develop new features for the upcoming or a distant future release. When starting development of a feature, the target release in which this feature will be incorporated may well be unknown at that point.
- release branches: These branches support preparation of a new production release. They allow for last-minute dotting of i’s and crossing t’s.
- hotfix branches: These branches are very much like release branches in that they are also meant to prepare for a new production release, albeit unplanned. They arise from the necessity to act immediately upon an undesired state of a live production version.
GitHub flow
GitHub Flow is a lightweight, branch-based workflow developed and used by GitHub. It's designed to be simple and easy to understand, especially for developers who are just getting started with Git.
The GitHub Flow has six steps:
Create a branch: From the repository, you create a new branch off the main branch to encapsulate your work. This is a core aspect of Git, and it allows you to work on separate tasks without affecting the main codebase.
Add commits: Make changes to your branch and commit them. Each commit is like a safe, small checkpoint for your work. Commit messages help document what changes were made and why.
Open a Pull Request (PR): Once you have made and committed your changes, you open a Pull Request. This is where the discussion about your proposed changes happens.
Discuss and review: Your changes can now be reviewed by others. They can comment on your code, suggest changes, or approve the PR.
Deploy: If everything is fine with your changes, you can deploy your branch to verify in production.
Merge: Once your changes have been reviewed and passed all tests, and you're happy with how they work in production, you can merge your changes into the main branch.
The GitHub Flow emphasizes the importance of deploying branches to production-like environments to test them before they're merged into the main branch. This allows for any necessary adjustments to be made before the code is merged into the main branch, reducing the chance of unexpected problems.
It's important to note that GitHub Flow is different from Git Flow. While Git Flow has specific branches for developing, testing, and releasing, GitHub Flow simplifies this to one concurrent line of development. This makes it a popular choice for continuous deployment environments, where new changes go live as soon as they're merged.
I would love to share a part of my preparation tips for job interview.
As a React developer, I'm currently on the lookout for new opportunities. If you know of any roles where my experience could be a good fit, I would love to hear from you.
You can reach out to me anytime at my email xMohammedAwad@gamil.com, or connect with me on LinkedIn. Check out my projects on GitHub to see more examples of my work.
Top comments (1)
what do you think