Maison > Questions et réponses > le corps du texte
周末在家里改了下代码,新建了个angular
版本的分支,然后push
到coding.net
上面了。
今天,到公司却不知道怎么拉取这个angular
分支到公司的电脑上面。
求指点,谢谢。。。
首先,我退回版本最初始(因为之前一直改一直改,可能会导致错误)
使用git reset --hard commit_last
接着执行如下:
git
>git pull origin angular:angular error: The following untracked working tree files would be overwritten by merge: >git checkout angular error: The following untracked working tree files would be overwritten by checko ut: >git clean -d -fx ""
然后就可以了!
非常感谢~~~
按1楼的解答得出:
到了代码冲突部分。
怪我咯2017-04-28 09:07:10
git checkout -b angular
git pull origin angular
MISE À JOUR
angular
La branche n'est pas développée en fonction de la branche actuelle ?
Vous pouvez revenir aux commits de leurs ancêtres communs et continuer checkout -b
. Si les deux branches sont des bases de code complètement différentes, vous pouvez utiliser git checkout -b --orphan angular
pour créer une toute nouvelle branche.
滿天的星座2017-04-28 09:07:10
git pull <nom d'hôte distant> <nom de branche distante>:<nom de branche locale>
巴扎黑2017-04-28 09:07:10
La méthode que j'utilise est
1.git fetch origin <远程分支名>
À ce moment-là, il y aura une succursale locale
Utilisez git branch -r
pour voir, le résultat général est origin/HEAD -> origin/master
origin/master
origin/<远程分支名>
2. Créez une nouvelle branche localement et mettez-y cette branche git checkout -b <本地分支名> origin/<远程分支名>