我从ChildRepo
分叉了一个存储库ParentRepo
,然后我克隆了ChildRepo
和
ChildRepo/project_name > git checkout develop
ChildRepo/project_name (develop) > git status //modified: README.md
ChildRepo/project_name (develop) > git remote -v //git@github.abc.com:cm/project_name.git
ChildRepo/project_name (develop) > git add .
ChildRepo/project_name (develop) > git commit -m "Style"
ChildRepo/project_name (develop) > git push
推入ChildRepo
后,这些更改会反映在ParentRepo
和ChildRepo
中,我不知道为什么,请让我知道,因为我只想在{{1 }}
答案 0 :(得分:1)
您应该检查从git remote -v
获得的remote-url,它应该指向您自己的分叉存储库(子存储库),而不是父存储库。如果它指向父存储库,则使用
git remote add upstream <child repo's remote-url>
然后,您可以使用
将更改推送到仅子存储库git push <upstream/origin (whichever is pointing to child repo)> <Your branch name>