Git:将本地目录置于修订控制之下

Max*_*aga 3 git

举个例子,假设我的主目录中有一个旧的 phpMyAdmin 副本(不受版本控制)。我想将它从“稳定”分支升级到最新版本。

所以基本上,我只想能够做到

git pull
Run Code Online (Sandbox Code Playgroud)

并将我的 phpMyAdmin 副本“升级”到最新版本。

那可能吗?我假设我需要先将 phpMyAdmin 置于修订控制之下。

谢谢!

GoZ*_*ner 5

如果您需要保留现有代码,请为自己准备一个 Git 存储库:

cd <dir>; git init; git add --all .; git commit -m 'Initial commit'
Run Code Online (Sandbox Code Playgroud)

然后添加远程和拉(master->master)

git remote add origin <path-to-remote>;
git pull origin master
Run Code Online (Sandbox Code Playgroud)

如果您不需要现有的代码库(这听起来不像您要问的那样):

git clone <path-to-remote> <into-some-dir>
Run Code Online (Sandbox Code Playgroud)

然后您可以diff在两个目录(原始和新克隆)上使用工具。