Skip to content

Commit

Permalink
auto_update
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Apr 10, 2024
1 parent 7a0a0ac commit e168d40
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source/_posts/软件工程/git常用.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ git 命令选项非常多,对于软件开发只需熟练掌握其中十几个
## 仓库操作
### 分支操作
1. clone分支
git clone <远程仓库的网址> -b <分支名称> <本地目录>
`git clone <远程仓库的网址> -b <分支名称> <本地目录>`

1. 创建分支
git checkout -b <分支名称>
`git checkout -b <分支名称>`

1. 删除分支
git branch -d <分支名称> # 删除分支
git push origin --delete <远程分支名>
`git branch -d <分支名称> # 删除分支`
`git push origin --delete <远程分支名>`

1. 远程关联
git remote set-url origin [email protected]:yourusername/yourrepo.git
git remote -v
`git remote set-url origin [email protected]:yourusername/yourrepo.git`
`git remote -v`

git push <远程主机名> <本地分支名> <远程分支名>
git push origin lcj_qemu:master
`git push <远程主机名> <本地分支名> <远程分支名>`
`git push origin lcj_qemu:master`

1. 合并与变基
git merge <分支名称>
Expand Down

0 comments on commit e168d40

Please sign in to comment.