How to read file's content from GitHub file with a specific branch name?
How to read file's content from GitHub file with a specific branch name? In branch name, qa03 , in my repository, repo1 , I have a file, environment.yml . qa03 repo1 environment.yml The content of environment.yml is following: environment.yml # This is chef config file chef: - xxx/chef - xxx/faster-git-clone bam: - xxx/asd - V20180820_902 I want to read this whole file from my python script and store it into my string (so that I can send it to my Trello Card). Q: How do I read the content of the file from GitHub repo with specific branchname? (below is my pseudocode) .... # Read `environmet.yml from repo1/qa03`, and send it to Trello. string_content = read('repo1:qa03/environment.yml') #Q: how??? send(string_content) 1 Answer 1 you can get branch by modifying the following part of the url: https://github.com/username/repositoryName/blob/branchName/path/to/file or in your case: ...