初次提交
git init
git add README.md
git commit -m "first commit"
git remote add origin xxx (xxx表示git的ssh地址)
git push -u origin master -f (-f表示强制推送,会覆盖远程已有的文件,如果远程仓库没有文件,可以不加)
之后修改
git commit -am 'what you change'
git push
添加远程仓库地址
git remote add [自定义英文名称] [url地址]
如:
git remote add github git@github.com:aaa/test.git
切换远程地址并提交
git remote set-url origin [url地址]
git add .
git commit -am 'change url'
git push -u origin master
查看当前远程地址
git remote show origin
添加所有改动的
git add .
拉取
git pull [remote] [branch]
本地切换分支
查看远程分支
git branch -a

image.png
查看本地分支
git branch

image.png
切换分支
git checkout -b jjj origin/jjj

image.png
合并其他分支到当前分支
git merge master

image.png
网友评论