Copy GitLab main branch code to GitHub DEV branch || replace GitLab main branch with GitHub DEV branch
Step:1 Clone GitLab Repository
- If you haven't already, clone your GitLab repository to your local machine.
git clone <GitLab_Repository_URL>
Step:2 Add GitHub Repository as a Remote
- Add the GitHub repository as a remote to your local GitLab repository.
Step:3 Fetch the GitHub DEV Branch
- Fetch the main branch from the GitHub repository.
Step:4 Reset GitLab Main Branch
- Reset the GitLab main branch to match the GitHub DEV branch.
- Checkout to main if you are currently not in main branch in your locally,then run below command
Step:5 Force Push to GitLab
- Force-push the updated main branch to the GitLab repository.
- Warning: Be cautious with force-push, as it overwrites the branch on the remote repository. Make sure you have backups and that no one else is working on the same branch.
If you have any doubt ,any question you can ask me......!

Comments
Post a Comment