1、上传一个独立的分支(好比代码是从工程中直接DOWNLOAD ZIP文件如BowlingScore-test.zip,该文件与原MASTER分支是独立的)git
一、Git init (在本地工程目录下),生成.git 文件夹github
Git init
二、上传修改的文件sql
git add *
(*可替换成具体要上传的文件名,*表示提交全部有变化的文件) 三、添加上传文件的描述
git commit -m "test"
(”test“为分支名)
四、(建立分支)ide
git branch test
五、(切换分支)ui
git checkout test
六、与远程分支相关联spa
git remote add origin https://github.com/yangxiaoyan20/BowlingScore.git
(”BowlingScore“ 为工程名)
七、(将分支上传)code
git push origin test
注意:提示 “请输入github用户名和密码“server
2、上传一个与MASTER相关的分支(该分支是从MASTER中git clone 获得,相关信息在 .git 文件中)blog
修改后源码后,在进行以下操做ip
一、git add . 二、git commit -m "test" (”test“为分支名) 三、git branch test(建立分支) 四、git checkout test (切换分支) 五、git push origin test:test