我现在想把repo https://github.com/jiangxiaoqiang/crx-selection-translate代码从github拉到我的本地机器上。我切换到遥控器。x-master分支在谷歌chrome浏览器在github中找到这个分支包含源代码,但当我想拉源代码到我的本地机器使用这个命令:
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% git pull -v
POST git-upload-pack (122 bytes)
From https://github.com/jiangxiaoqiang/crx-selection-translate
= [up to date] 6.x-master -> origin/6.x-master
= [up to date] 4.x-master -> origin/4.x-master
= [up to date] 5.x-master -> origin/5.x-master
= [up to date] 7.x-master -> origin/7.x-master
= [up to date] porting-to-firefox -> origin/porting-to-firefox
Already up to date.
告诉我已经更新了,但是我的本地机器没有包含任何源代码:
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% git branch
* 6.x-master
7.x-master
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% ls
README.md
我错过了什么吗?我应该做些什么来获取github远程6.x-master
源代码到我的本地机器?我还尝试了这个命令:
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% git pull origin 6.x-master
From https://github.com/jiangxiaoqiang/crx-selection-translate
* branch 6.x-master -> FETCH_HEAD
Already up to date.
分支X-master从7点结账。
在我的工作中,我总是使用这个命令从远程分支A拉出本地分支A:git pull origin A
,它似乎在这个repo中不起作用。我不知道我哪里做错了,真奇怪。当我运行git status时,显示如下信息:
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% git status
On branch 6.x-master
Your branch is ahead of 'origin/6.x-master' by 16 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
然后我运行git push命令:
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% git push
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/jiangxiaoqiang/crx-selection-translate.git
5a9ca26..12b9ef2 6.x-master -> 6.x-master
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% git pull
Already up to date.
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% ls
README.md
仍然没有6.x-master的源代码。我还尝试了这个命令:
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub% git clone -b 6.x-master https://github.com/jiangxiaoqiang/crx-selection-translate.git
Cloning into 'crx-selection-translate'...
remote: Enumerating objects: 4587, done.
remote: Counting objects: 100% (85/85), done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 4587 (delta 27), reused 15 (delta 5), pack-reused 4502
Receiving objects: 100% (4587/4587), 1.55 MiB | 734.00 KiB/s, done.
Resolving deltas: 100% (2816/2816), done.
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub% cd crx-selection-translate
[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/crx-selection-translate% ls
README.md
仍然不包含源代码。
你写了
分支X-master从7点结账。X-master在我的本地机器
你写的git status
的输出是
On branch 6.x-master
Your branch is ahead of 'origin/6.x-master' by 16 commits.
这告诉我你的情况是这样的:
o <-- origin/7.x-master <-- 6.x-master
|
o
|
[... 14 other commits ...]
|
o
|
o <-- origin/6.x-master
|
o
|
但是你想:
o <-- origin/7.x-master
|
o
|
[... 14 other commits ...]
|
o
|
o <-- origin/6.x-master <-- 6.x-master
|
o
|
。,您的本地6.x.-master
分支在前面太远。
origin/6.x-master
:
git checkout 6.x-master
git reset --hard origin/6.x-master
您还写了
[
git pull
]告诉我已经更新了,但是我的本地机器没有包含任何源代码
没有源代码,因为那是origin/7.x-master
分支的状态,你已经签出了本地名称6.x-master
。