![](/cvo_files/imgs_sap_abap/logos/logo_cvo_academy_it.png)
✒️SAP Fiori Los sistemas de control de versiones
SAP Fiori Los sistemas de control de versiones
![SAP Fiori Los sistemas de control de versiones SAP Fiori Los sistemas de control de versiones](https://www.cvosoft.com/cvo_files/imgs_sap_abap/og-images/379.jpg)
1 | Version Control Systems
Centralized and Distributed Version Control Systems
Version control systems are essential tools for managing changes to source code over time. There are two primary types: centralized and distributed.
- Centralized Version Control Systems (CVCS): In a centralized system, such as Subversion (SVN), all version history is stored on a central server. Developers check out files, work on them locally, and then check the files back into the central server. This setup means that to work on the code, you must be connected to the server.
- Distributed Version Control Systems (DVCS): In contrast, a DVCS like Git, Mercurial, or Bazaar allows each developer to have a full copy of the repository on their local machine. This enables them to work offline and later synchronize their changes with the central repository once they reconnect to the network.
Advantages of Distributed Version Control Systems:
- Change Tracking: Every change to the files is recorded with details such as the time, the author, and a message describing the change.
- Synchronization: Multiple developers can work on the same project simultaneously and keep their copies up-to-date with the latest changes.
- Backup and Restoration: Changes can be saved, and any file can be restored to any previous state.
- Branching and Merging: Developers can create branches to work on new features independently and merge them back into the main project when ready.
Characteristics of Git:
Git is particularly noted for its efficiency in managing branches. It allows developers to make changes in separate branches and merge them with the main project effortlessly. This makes it an invaluable tool for collaborative development.
2 | What is Git?
Git is a powerful version control system used to manage and track changes in code. It is known for its speed, simplicity, and reliability in maintaining versions of projects with numerous files. Git was designed to facilitate efficient, collaborative development by allowing developers to work on their local copies and synchronize changes with a global repository.
Benefits of Git:
- Speed and Efficiency: Git is exceptionally fast in handling branches, which makes it suitable for large projects.
- Distributed Development: Every developer has a complete copy of the repository, allowing for offline work and reducing the risk of data loss.
- Flexibility: Branching and merging are core features that support multiple lines of development.
- Open Source and Community Support: Git is free and open-source, with extensive community support and numerous resources available.
3 | Advantages of Git
Git provides several significant advantages over traditional version control systems:
- No Single Point of Failure: Being a distributed system, Git does not rely on a central server, which allows work to continue even if the server is down.
- Integration: Git integrates seamlessly with various development tools and platforms, supporting continuous integration and deployment, automated testing, and work item tracking.
- Community Support: Git's popularity ensures robust community support, abundant resources, and tools for developers.
- Team Productivity: Git enhances team productivity by enabling collaboration, policy enforcement, process automation, and improved visibility of work.
- Branch Policies and Pull Requests: Platforms like GitHub and Azure DevOps allow teams to set branch policies and conduct code reviews through pull requests, ensuring code quality and knowledge sharing.
4 | The Distributed System
The Repository
A Git repository is a collection of files and their version history, organized in a directory structure. It includes the following key areas:
- Working Directory: The workspace where developers modify files. Changes here are in the "Modified" state.
- Staging Area: Files that are staged for the next commit. These changes are in the "Prepared" state.
- Git Repository: The database where committed changes are stored permanently. Once changes are committed, they move from the "Prepared" to the "Confirmed" state.
The Three States in Git:
- Modified: Changes are made in the working directory.
- Staged: Changes are selected and staged in preparation for a commit.
- Committed: Changes are saved in the repository.
5 | The Stages of a File in Git
Workflow and Commands
- git add: Moves changes from the working directory to the staging area.
- git commit: Records the staged changes in the repository with a descriptive message.
Branching and Merging
Branches are essential for managing different lines of development. The main branch, typically called "master" or "main," contains the stable code ready for production. Other branches are created for new features or fixes and are merged back into the main branch once the work is complete.
- Creating a Branch: Use git checkout -b branch_name to create a new branch.
- Merging Branches: Use git merge branch_name to merge changes from a branch into the current branch.
Advanced Workflows
In advanced workflows, continuous integration systems automatically check for conflicts during merges. Developers are notified of conflicts, which they must resolve before the merge is completed. Once resolved, changes are merged into the "development" branch and then into "master" for production deployment.
# Basic Commands
# Initialize a new Git repositorygit init
# Clone a repository into a new directorygit clone <repository_url>
# Show the working directory statusgit status
# Add a file to the staging areagit add <file>
# Commit changes with a messagegit commit -m "commit message"
# Show the commit historygit log
# Show changes between commits, commit and working tree, etc.git diff
# Display help information about Gitgit help
# Set the global usernamegit config --global user.name "Your Name"
# Set the global email addressgit config --global user.email "your.email@example.com"
# Intermediate Commands
# List all branchesgit branch
# Create a new branchgit branch <branch_name>
# Switch to a different branchgit checkout <branch_name>
# Merge a branch into the current branchgit merge <branch_name>
# List remote repositoriesgit remote -v
# Fetch branches and commits from the remote repositorygit fetch
# Fetch and merge changes from the remote repositorygit pull
# Push changes to the remote repositorygit push
# Remove a file from the working directory and staging areagit rm <file>
# Stash changes in the working directorygit stash
# Apply stashed changesgit stash pop
# Create a new taggit tag <tag_name>
# Show various types of objects (commits, tags, etc.)git show <commit>
# Advanced Commands
# Reapply commits on top of another base tipgit rebase <branch_name>
# Apply the changes introduced by some existing commitsgit cherry-pick <commit>
# Revert a previous commitgit revert <commit>
# Reset current HEAD to the specified stategit reset <commit>
# Start binary search to find the commit that introduced a buggit bisect start
# Mark the current commit as badgit bisect bad
# Mark the current commit as goodgit bisect good
# Show the reference logsgit reflog
# Rewrite branches with a filtered historygit filter-branch --tree-filter '<command>' HEAD
# Show what revision and author last modified each line of a filegit blame <file>
# Add a new submodule to the repositorygit submodule add <repository_url>
# Cleanup unnecessary files and optimize the local repositorygit gc
 
 
 
Sobre el autor
Publicación académica de Jaime Eduardo Gomez Arango, en su ámbito de estudios para la Carrera Consultor en SAP Fiori.
Jaime Eduardo Gomez Arango
Profesión: Ingeniero de Sistemas y Computación - España - Legajo: SW34C
✒️Autor de: 149 Publicaciones Académicas
🎓Cursando Actualmente: Consultor en SAP Fiori
🎓Egresado de los módulos:
Disponibilidad Laboral: FullTime
Presentación:
Ingeniero de sistemas y computación con 8 años de experiencia el desarrollo frontend & backend (react/node) y en cloud (aws), actualmente desarrollando habilidades en sap btp, ui5, abap y fiori.
Certificación Académica de Jaime Gomez