git 分支

#新建仓库
git init
git clone ****
#修改.git/config
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url =    https://github.com/icesongqiang/****
    fetch = +refs/heads/*:refs/remotes/origin/* 
    pushurl = https://github.com/icesongqiang/***
[branch "master"]  
    remote = origin  
    merge = refs/heads/master
#git config user.name XX
#git config user.email XXX
#新建分支以及选择到新的分支
git branch -b qiansong
git checkout qiansong
##上两条等价于 git checkout -b qiansong

# ...
# 可以编辑新的分支,增删改
# ...
#修改完查看状态
git status 
# 添加修改的到仓库
git add .
#提交,版本切换前必须提交当前编辑的版本
git commit -a -m “this is a test”
#回到master
git checkout master
#合并新分支到master
git merge qiansong
#先拉一下网上的新码
git pull
#可以提交到网上
git push
# 切换到分支
git checkout qiansong
#合并刚刚 master 拉下来的代码
git merge master

你可能感兴趣的:(git 分支)