バージョン管理外のコードをリポジトリに追加する
リポジトリをセットアップする
このページの内容
関連コンテンツ
If you have code that is currently not under version control and you want to start controlling it, you can prepare it by putting your code into a Git repository locally. From there, you push it to Bitbucket.
Bitbucket リポジトリを持っていない場合は、最初にリポジトリを作成します。
Git リポジトリに追加する
- ターミナルから、既存のコードのルート ディレクトリに変更します。
次のコマンドで、バージョン コントロール用のディレクトリを初期化します。
$ git init
既存のファイルを、初期化したリポジトリに追加します:
$ git add .
ファイルをコミットします:
$ git commit -m "initial commit of full repository"
macOS では、コメント メッセージの前後を一重引用符またはニ重引用符で囲むことができます。Windows では、ニ重引用符を使用する必要があります。
新しいローカル Git リポジトリを、Bitbuckekt のリモート リポジトリに接続します。これを行うには、「
git remote add origin
」とリモート URL を入力します。$ git remote add origin <bitbucket_URL>
URL はリポジトリの
git clone
コマンドの横にあります。次のコマンドを使用して、ローカル リポジトリから Bitbucket にすべてのコードをプッシュします。
$ git push -u origin --all
最終更新日 2020 年 7 月 1 日
関連コンテンツ
Powered by Confluence and Scroll Viewport.