1

プロジェクトベースにいくつかの主要な更新が加えられた GitHub リポジトリに移動されたプロジェクトを扱っています。ただし、同じプロジェクトベースで作業している人は、更新されていないバージョンしか持っていません。ローカルの非 git リポジトリをローカルの git リポジトリに変換し、同じプロジェクトの新しいバージョンで更新する方法。

私はgitのすべてのドキュメントを調べましたが、まだ明確ではありません

4

2 に答える 2

0

彼らの仕事を維持するための最良の方法は次のとおりです。

# current dir is ~/oldversion
# create a new directory 
mkdir ~/newversion
# get the clean versioned project
git clone git@github.com:Your/repo .
# create a new local branch and go on it
git checkout -b migration
# now copy everything from the old project. the modified files will appear with "git status"
cp -r ../oldversion/* ./
# commit the last work
git commit --all -m "importing to git"
# now, make some checks/editio, git diff, git rm, git revert, git checkout path/to/file whatever
...
# then import your work in a branch for everyone, if you use master that means
git checkout master
git merge migration --no-ff -m "migrated by me"

scm を使用した場合は、.svn ディレクトリなど、一部のファイルを一時的に除外することをお勧めします。

于 2013-01-24T10:10:18.643 に答える
0

1つの方法は次のとおりです。

于 2013-01-24T08:22:10.677 に答える