git clone git@192.168.1.251:/home/gitrepetory/p1.git
git remote add origin git@192.168.1.251:/home/gitrepetory/p1.git
git init 初始化
git add
git commit
git pull
git push
关联远程仓库
git remote add origin git@git.oschina.net:yourname/demo.git
可能会出现的问题:
如果第二步写错了:则
git remote rm origin //删除origin
git remote add origin git@git.oschina.net:yourname/demo.git //重新添加origin
关联远程分支
git branch --set-upstream-to origin develop
合并分支
git merge develop
删除分支
git branch -d develop
已有项目添加
1.git add . (将当前目录下的文件加入到仓库)
2.git commit -m"the first commit project"(第一次提交项目文件)
3.gitremote add origin https://git.coding.net/solent/xingzuo.git
4.git push -u origin master (推送远程仓库)