PHP高级工程师|全栈工程师|WX: Aben_Ring

git 基本操作

** git对应分支确立跟踪关系 **
目录.git文件夹下有个config文件

[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[remote "origin"]
	url = git@gitlab.ec2.nmi.hk:minisites/archive.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
[branch "release"]
	remote = origin
	merge = refs/heads/release

[remote "origin"] 代表git远程目录
[branch "master"] 代表跟踪关系

注意:新建一个分支(branch_001)后,可能回事这种跟踪关系。此时最好将refs/heads/master改成 refs/heads/branch_001,这样在push或者pull的时候,就直接git push 或者git pull就行了

[branch "branch_001"]
	remote = origin
	merge = refs/heads/master
[branch "branch_001"]
	remote = origin
	merge = refs/heads/branch_001
posted @ 2019-07-16 09:04  懒牛拉车  阅读(230)  评论(0编辑  收藏  举报