Files
knowledge-kit/第五部分 开发杂谈/5.4.md
2020-02-25 17:35:10 +08:00

31 lines
642 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### git常见使用
```
http://blog.csdn.net/wirelessqa/article/details/20153689
```
1. git init
2. git add .
3. git commit -am "\#\#\#"
4. git remote add origin git@xx.xx.xx.xx:repos/xxx/xxx/xxx.git
5. git push origin 本地分支:远程分支
fatal: refusing to merge unrelated histories
决办法git pull origin master --allow-unrelated-histories
### 创建新版本
* 从现有的分支创建新分支
* git checkout -b dev
* 将新创建的分支提交到远端
* git push origin dev
* 提交代码
* git add .
* git commit -m 'add a new branch named dev'
* git pull origin dev
* git push origin dev