【ソフト工学】Gitコマンド
よく使用のコマンド
远程仓库相关
检出仓库:git clone git://github.com/jquery/jquery.git
查看远程仓库:git remote -v
添加远程仓库:git remote add [name] [url]
删除远程仓库:git remote rm [name]
修改远程仓库: git remote set-url —push[name][newUrl]
拉取远程仓库: git pull [remoteName] [localBranchName]
推送远程仓库: git push [remoteName] [localBranchName]
上传项目到远程分支
1.初始化本地仓库Git init
2.上传修改的文件git add *
3.commit 文件git commit -m "test"
4.创建分支git branch test
5.切换分支git checkout test
6.关联远程分支git remote add origin https://github.com/yangxiaoyan20/BowlingScore.git
7.pushgit push origin test
修改后重新push
1、git add .
2、git commit -m “test” (”test“为分支名)
3、git branch test(创建分支)
4、git checkout test (切换分支)
5、git push origin test:test
commit,然后pull,然后再push
error:
1.fatal: refusing to merge unrelated histories
git pull origin master -–allow-unrelated-histories