Reputation: 2065
I'm writing some automatic scripts using Bitbucket Server API. I have a lot of actions here, with pull request creation, etc.
For some reason I need to synchronize some branch with remote and merge with other branches(git merge).
Is it possible to do something like:
git checkout my_branch
git pull
git merge another_branch
I can do this staff via direct shell calls, but it requires branch cloning, etc.
Any ideas?
Upvotes: 0
Views: 1193
Reputation: 4085
There is a new edit API (since 4.13) if you just want to edit a single file. Git itself is the API we'd recommend for manipulating Git repos otherwise.
Regarding repo sizes, you can do a shallow clone with modern versions of Git to pull down less data, and still push back. Depending on your scenario, you might also be able to maintain a local copy over time instead of cloning each time.
Upvotes: 1