'How do I use bash commands to merge two separate GitHub branches (each several commits ahead of the main) into the main branch?
As part of my graduate research, I collect field data that gets entered into CSV files daily. I have all my data within a private GitHub repository. My technicians and I each enter our data on separate branches and push changes to GitHub using bash commands.
I need to merge both the branches, which are several commits ahead of the main branch, into the main.
After committing/pushing changes made to each branch, I have tried:
git checkout main #switches to the main branch
git merge MyBranch #merges the changes I've made to the CSV file
git push origin main #pushes the merge to GitHub
Here's the issue, when I run the following, a merge conflict is generated:
git merge TechsBranch #merges the changes my technicians made to their CSV file
It's my understanding a merge conflict arises because the main is now ahead of the TechsBranch, which makes sense to me. I'm struggling to find a solution to this issue. I can provide further information if needed.
Thanks everyone!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|