Introduction To Git and GitLab
Introduction To Git and GitLab
Commit Changes
Create a commit with a descriptive message explaining the changes
you've made using 'git commit -m "Your commit message".'
Push to GitLab
Use 'git push origin main' to upload your local changes to the remote
GitLab repository, making them accessible to others.
Branching and merging in GitLab
Create a branch
1 Make a copy of the main branch to work on a new feature.
Make changes
2
Modify code on the branch without affecting the original code.
Commit changes
3 Save your work on the branch with descriptive commit
messages.
Merge branch
4 Integrate the changes from your branch into the
main branch.
Branching allows teams to work on different tasks simultaneously without disrupting others. Merging
combines changes from a branch into the main branch, updating the project with new features or bug
fixes.
Resolving Conflicts and Managing Issues
Identify Conflicts
1
GitLab will highlight conflicting changes when merging branches.
Resolve Conflicts
2
Manually edit the code to combine changes from both branches.
Commit Resolution
3 Commit the resolved changes to the branch and complete
the merge.
Issue Tracking
4 GitLab provides a platform for reporting,
managing, and resolving issues.
Conflicts occur when two developers make changes to the same part of the code. GitLab's conflict
resolution tools help you identify and resolve these issues. GitLab's issue tracking system allows for
efficient collaboration on bug fixes and feature requests.
Best Practices and Tips for Using Git and
GitLab