其他分享
首页 > 其他分享> > Git内部原理之深入解析引用规范

Git内部原理之深入解析引用规范

作者:互联网

一、引用规范

$ git remote add origin https://github.com/schacon/simplegit-progit
[remote "origin"]
	url = https://github.com/schacon/simplegit-progit
	fetch = +refs/heads/*:refs/remotes/origin/*
$ git log origin/master
$ git log remotes/origin/master
$ git log refs/remotes/origin/master
fetch = +refs/heads/master:refs/remotes/origin/master
$ git fetch origin master:refs/remotes/origin/mymaster
$ git fetch origin master:refs/remotes/origin/mymaster \
	 topic:refs/remotes/origin/topic
From git@github.com:schacon/simplegit
 ! [rejected]        master     -> origin/mymaster  (non fast forward)
 * [new branch]      topic      -> origin/topic
[remote "origin"]
	url = https://github.com/schacon/simplegit-progit
	fetch = +refs/heads/master:refs/remotes/origin/master
	fetch = +refs/heads/experiment:refs/remotes/origin/experiment
fetch = +refs/heads/qa*:refs/remotes/origin/qa*
[remote "origin"]
	url = https://github.com/schacon/simplegit-progit
	fetch = +refs/heads/master:refs/remotes/origin/master
	fetch = +refs/heads/qa/*:refs/remotes/origin/qa/*

二、引用规范推送

$ git push origin master:refs/heads/qa/master
[remote "origin"]
	url = https://github.com/schacon/simplegit-progit
	fetch = +refs/heads/*:refs/remotes/origin/*
	push = refs/heads/master:refs/heads/qa/master

三、删除引用

$ git push origin :topic
$ git push origin --delete topic

标签:origin,Git,refs,remotes,git,master,引用,解析
来源: https://blog.csdn.net/Forever_wj/article/details/120515488