Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

GitHub

Push source to GitHub/GitLab repository without type password

Background The passphrase stored in ssh-agent is invalidated when the git client machine is rebooted. If you want to access GitHub/GitLab without type password (e.g. push/pull source in Jenkins), you have to use a ssh public/public key pai…

Invoke-RestMethod to GitLab API causes mojibake

Context In PowerShell, You can call REST API with Invoke-RestMethod like: Invoke-RestMethod -Headers $headers -Method Get -Timeout 10 -Uri "https://api.github.com/users/octocat/orgs" Problem The result of Invoke-RestMethod causes mojibake …

Difference of GitHub API and GitLab API

Format of Personal Access Tokens In GitHub, personal access tokens are hex string, like e72e16c7e42f292c6912e7710c838347ae178b4a. In GitLab, personal access tokens are like Base62 string, like 9koXpg98eAheJpvBs5tK. Personal Access Tokens a…

You cannot have two forks from one repository in GitHub

Problem: “Fork” button in GitHub forks a repository into your account. You cannot rename the repository when you fork it. You cannot have two repositories with identical name. So, you cannot have two forks from one repository simultaneousl…

ISO/IEC 12207 (JIS X 0160:2012) ソフトウェア構成管理プロセスのうちバージョン管理システム、GitHub/GitLab/etc、git-flow/GitHub Flowでカバーできる内容

(In English: What can you do for ISO/IEC 12207 (JIS X 0160:2012) Software Configuration Management Process with VCSs, GitHub/GitLab/etc, and git-flow/GitHub Flow) ISO/IEC 12207 (JIS X 0160:2012)では、ソフトウェア開発におけるソフトウェア構…

Meanings of :owner, :repo, ... in GitHub API document

In GitHub API document (ex. https://developer.github.com/v3/repos/ ), examples of how to access API showed like GET /repos/:owner/:repo/contributors. Meanings of indicator variable-like valiables such as :owner, :repo are listed below: # v…

URL of GitHub Enterprise API is different from github.com's one

Problem: I have tried to access GitHub Enterprise API with a URL like showed below, based on examples from some websites, but the response was 404 error. https://x.x.x.x/repos/Project/Repository/git/refs/heads Reason: URL of GitHub Enterpr…

The creator of branch is not contained in return values of GitHub API

Context: On GitHub, you can see which branches have you created (see “Your branches” section of “Branches” page). Problem: In GitHub API, there is no way to get the creator of the branches. The return values of GitHub References API don’t …

You can't access HTTP responce headers with Invoke-RestMethod

Context: You can call API of web services (e.g. GitHub) with Invoke-RestMethod. GitHub pagination API contains the last page number in HTTP responce headers. Problem: You can’t access HTTP responce headers with Invoke-RestMethod or the ret…