git Repo Branch

From GM-RKB
Jump to navigation Jump to search

A git Repo Branch is a lightweight movable pointer to a git commit.



References

2023

  • GBard
    • A repo branch is a way to isolate changes to a codebase in a version control system like Git. It is lightweight moveable pointer to one of the commits in the repository (to a snapshot of a repository at a specific point in time). It is a way to isolate changes from the main codebase, making it easier to develop and test new features, fix bugs, and collaborate with other developers.
      • Developing new features or fixing bugs: You can create a new branch to work on a new feature or fix a bug without affecting the main codebase. This allows you to experiment and make changes without worrying about breaking the production code.
      • Collaborating with others: You can share branches with other developers so that they can contribute to your work or review your changes. This is a great way to get feedback and ensure that your code is of high quality.
      • Releasing new versions: You can create a branch to prepare for a new release of your software. This allows you to make changes and test the new release without affecting the production code. Once the new release is ready, you can merge the branch into the main codebase and deploy it to production.
    • ...
      • Main branch: The main branch is the main codebase of a repository. It is the branch that is deployed to production, and it should always contain stable, working code. The main branch should only be updated when new features or bug fixes are ready to be released to users.
      • Staging branch: The staging branch is used to prepare code for release to production. It is a branch where developers can test their changes and make sure they are ready to be merged into the main branch. The staging branch should be updated frequently, and it should always be in a deployable state.
      • Development branch: The development branch is used for ongoing development. It is a branch where developers can work on new features, fix bugs, and experiment with changes. The development branch should not be merged into the main branch until the changes are ready to be released to users.

2023

2017

2015

  • https://git-scm.com/docs/git-clone
    • git-clone ... Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -r), and creates and checks out an initial branch that is forked from the cloned repository’s currently active branch. ...