Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

GibHub API - How to edit a file on a feature branch its always defaulting to master?

Input given 

{
  "message": "my commit message",
  "committer": {
    "name": "Scott Chacon",
    "email": "schacon@gmail.com"
  },
  "content": "bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz",
  "sha": "329688480d39049927147c162b9d2deaf885005f"
"branch" : "NewFeature" }

 

Trying to edit a file on Newfeature branch but its getting edited on master?

https://github.ibm.com/api/v3/repos/project/repo/contents/test.txt

 

Tried this as well https://github.ibm.com/api/v3/repos/project/repo/contents/test.txt?ref="NewFeature"

 

Did not help.

 

Appericate your help

Thanks!

2 Replies
Community Manager
Message 2 of 3

Re: GibHub API - How to edit a file on a feature branch its always defaulting to master?

Does the branch already exist? If not, you may want to try creating it first.

 

I hope that helps!

Ground Controller Lvl 2
Message 3 of 3

Re: GibHub API - How to edit a file on a feature branch its always defaulting to master?

Hello, I want to edit a file by GibHub API. Can you help me use it ? Thanks