Posts

Showing posts with the label github

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: ...

Git Clone Repo to Ubuntu Server Key Error

Git Clone Repo to Ubuntu Server Key Error I am trying to clone my remote github repo to my EC2 Ubuntu server. When I run sudo git clone git@github.com:user/test.git sudo git clone git@github.com:user/test.git I have the message Cloning into 'test'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. What do I need to setup to get my github repo in my server? Are there keys I need to add to my Github account? My server? 1 Answer 1 GitHub isn't able to authenticate you.Your SSH key is not authorised. I would suggest you to get a look at the following links because this subject has already been treated: Link 1 Subject: GitHub Error Message - Permission denied (publickey) Link 2 Subject: Permission denied (publickey) Hope this helped ! By clic...