我从 GIT 存储库(最新)克隆。此时,存储库中的最新提交是:a10cb09
我使用以下命令进行克隆(我在我的小包装脚本中设置变量r
= 传递的第一个参数(对于 repo name aka ):ansible
git clone git@github.com:mycompany/${r}.git
并进行了一些更改并执行了以下简单步骤:(即进行更改,添加文件/文件夹,提交和推送),我得到了一个新的提交哈希a08c263
(短)。
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
roles/mycompany.mycompany-ansible/
mycompany-ansible.yml
nothing added to commit but untracked files present (use "git add" to track)
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $ git add mycompany-ansible.yml roles/mycompany.mycompany-ansible
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $ git commit -m "mycompany.mycompany-ansible playbook and role" mycompany-ansible.yml roles/mycompany.mycompany-ansible
[master a08c263] mycompany.mycompany-ansible playbook and role
14 files changed, 1771 insertions(+)
create mode 100644 roles/mycompany.mycompany-ansible/README.md
create mode 100644 roles/mycompany.mycompany-ansible/defaults/main.yml
create mode 100644 roles/mycompany.mycompany-ansible/handlers/main.yml
create mode 100644 roles/mycompany.mycompany-ansible/meta/.galaxy_install_info
create mode 100644 roles/mycompany.mycompany-ansible/meta/main.yml
create mode 100644 roles/mycompany.mycompany-ansible/tasks/apt_install.yml
create mode 100644 roles/mycompany.mycompany-ansible/tasks/main.yml
create mode 100644 roles/mycompany.mycompany-ansible/tasks/yum_install.yml
create mode 100644 roles/mycompany.mycompany-ansible/templates/10-statsd.conf.j2
create mode 100644 roles/mycompany.mycompany-ansible/templates/10-mycompany.conf.j2
create mode 100644 roles/mycompany.mycompany-ansible/templates/proxy_auth_credentials.set.j2
create mode 100644 roles/mycompany.mycompany-ansible/templates/telegraf.conf.wfcopy.j2
create mode 100644 roles/mycompany.mycompany-ansible/templates/mycompany-proxy.conf.j2
create mode 100644 mycompany-ansible.yml
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $ git push
Counting objects: 21, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (21/21), 18.65 KiB | 0 bytes/s, done.
Total 21 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To github.com:repogroup/ansible.git
a10cb09..a08c263 master -> master
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $ git log -1 --pretty=format:%h
a10cb09
[arun@ip-10.20.30.33 ~/aks/always-latest-ws-repogroup/ansible] $ git rev-parse a08c263
a08c263
fatal: ambiguous argument 'a08c263': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
当我要去 Github 仓库查看我的最新更改时,它不存在。git log
也没有显示我的提交(相反,它向我显示了提交之前位于顶部的提交哈希)。我错过了什么?
似乎我什至看不到使用git rev-parse a08c263
(小散列)的长散列。
$ git remote -v
origin git@github.com:mycompany/ansible.git (fetch)
origin git@github.com:mycompany/ansible.git (push)
和
$ git reflog
a10cb09 HEAD@{0}: clone: from git@github.com:mycompany/ansible.git
PS:如果我对位于mycompany
repo 组下的其他存储库执行相同的步骤,并且如果我遵循类似的步骤,所有这些 repos 都会在 github 中成功获得我的提交/推送更改。
更新:我的浏览器页面之一仍然打开。在我提交+推送之后,我能够看到我提交的更改(新哈希a08c263
作为顶级 repo 级别的最新提交)。当我点击它时,它打开了这个附加的浏览器页面,我可以在其中看到完整的哈希以及文件夹/文件。如果我访问为我的提交打开的浏览器 URL,它仍然存在(所以 Git 确实保存了一些东西)但是单击存储库的根级别,即ansible
,最新的提交不是我的提交+推送(新哈希),但它被列为a10cb09
最新一个(每个快照是我新生成的哈希的父哈希)。看这里:
现在带来了主要问题:
如果我还没有打开这个浏览器页面,那么我将如何获得长哈希和我的文件夹/文件(内容)?
如果我从 github.com/mycompany/ansible (repo) 克隆,它是 ansible 存储库的 MIRROR,实际上托管在 Phabricator 中(其中实际的原始存储库克隆 URL 与我在上面的小脚本中使用的不同),那么我应该使用什么命令/选项将我的新更改推送到原始 Phabricator
ansible
存储库?如果提交+推送在我结束时完成,为什么
git log
和其他类似git
的命令没有显示任何针对我的新哈希的信息?