Git 相关

By kcersing , 17 一月, 2018

git config --global user.name "kcersing"
git config --global user.email "wt4@live.cn"

git init
git remote add origin 地址

git clone 地址
git pull origin master
<这里需要修改/添加文件,否则与原文件相比就没有变动>
git add * -f
git commit -m "app"
git push origin master

错误可能是因为在你以前pull下来的代码没有自动合并导致的.

1.保留你本地的修改
git merge --abort
git reset --merge
合并后记得一定要提交这个本地的合并
然后在获取线上仓库
git pull
分支切换问题
1.查看本地分支
git branch
查看所有的分支
git branch -a
2.切换分支
git checkout -b 分支名 origin/分支名

-------------------------------------
ssh生成秘钥
ssh-keygen -t rsa
at ~/.ssh/id_rsa.pub

标签