5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

既存のリポジトリをBitbucketに紐づけする方法

Last updated at Posted at 2022-03-27

はじめて使用したときに困ったので、備忘録として。(ときたま使用するときがあるし...)

ローカルリポジトリの準備

  1. Sourcetreeを用いて,ローカルリポジトリを作成.作業パスは追加したいファイルがあるパスを選択。

    • ex. "cd C:\Long\Coat\Daddy" (Daddy下にソースファイルやら何やら)
    • この時出力先のエラーが出るが「はい」を押して続行。
    • クローン作成先のパス"C:\Long\Coat\Daddy"は既に存在しています。続行して、このフォルダにリポジトリを作成しますか?
      create repositry.png
  2. 好きなのファイルをコミットする.

リモートリポジトリの準備

  1. Bitbucketにアクセス
    • 「+」ボタンからリポジトリを作成
      • リモートリポジトリ名:remoteLCD
    • このとき、.gitignoreを含むか聞かれますが、ローカルリポジトリの準備の時点で作成していたら、作成しないように!

ローカルリポジトリとリモートリポジトリの紐づけ

  • 「ローカルの Git リポジトリを Bitbucket に移行しましょう」の指示通りに行う.
  1. コマンドプロンプトを開く
  2. ローカルリポジトリに移動.(cd C:\Long\Coat\Daddyとか)
  3. 下記コマンドを入力
   git remote add origin https://xxx@bitbuckte.org/xxx/remoteLCD.git
  1. 下記コマンドを入力
     git push -u origin master
  • あとは、Bitbucket上で確認できます。
5
0
1

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
5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?