だから私はgitリポジトリを持っていて、それにディレクトリを貼り付けようとしています。リポジトリのクローンを作成し、新しいブランチをチェックアウトして、ディレクトリをサブ ディレクトリの 1 つに貼り付けます。したがって、ファイルパスは次のようになります
Repo/ios/parentDir/directoryPastedIn
parentDir で git ブランチを実行すると、チェックアウトしたブランチにいることがわかります。にいるときはdirectoryPastedIn
、そのブランチではなく にgit branch
いることを確認します。master
親ディレクトリにいるときにgitステータスを実行すると、これが表示されます(git add -Aを実行した後)-
# On branch someBranch
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: directoryPastedIn
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: directoryPastedIn (modified content)
#
ただし、directoryPastedIn に移動し、そのサブディレクトリのいくつかに移動して を実行するとgit status
、追跡されていないファイルがあることがわかります。これをリモートにプッシュすると、ディレクトリではなくバイナリ ファイルがプッシュされていることがわかります。
では、ディレクトリをローカルの git リポジトリに貼り付けてプッシュするにはどうすればよいでしょうか?