开发者

git pull branch with absolute path

开发者 https://www.devze.com 2023-03-07 21:36 出处:网络
I\'ve been using the following command for checkout: git --git-dir=C开发者_StackOverflow中文版:/home/www/project/.git --work-tree=C:/home/www/project/ checkout branch

I've been using the following command for checkout:

git --git-dir=C开发者_StackOverflow中文版:/home/www/project/.git --work-tree=C:/home/www/project/ checkout branch

I'm trying to replicate the same behavior for pull:

git --git-dir=C:/home/www/project/.git --work-tree=C:/home/www/project/ pull origin branch

It fails with the following error:

fatal: C:\Program Files (x86)\Git/libexec/git-core/git-pull cannot be used without a working tree.

What's wrong? Why it's not working? Please help!


Is there some reason you cannot run (cd c:/home/www/project && git pull origin branch) assuming you are using the msysgit bash shell.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号