LoginSignup
2
2

More than 5 years have passed since last update.

octokitで新規ブランチを切る

Last updated at Posted at 2015-09-28

octokitを使用してgithub上で新規リポジトリを切る方法のメモ。

branch.rb
rep_name = 'repository name'
ref_name = 'heads/master'
branch = 'heads/branch name'

client = Octokit::Client.new(login: 'user name', password: 'password')
repo = client.repositories.find{|r| r.name == rep_name}
ret = client.ref(repo.full_name, ref_name)
client.create_ref(repo.full_name, branch, ret.object.sha)

octokitでローカルのリポジトリでcheckoutする方法があれば知りたいところ。
(多分なさそうだなぁ)

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2