用到的 git 命令
生活随笔
收集整理的這篇文章主要介紹了
用到的 git 命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.創建分支
git branch branch_name
2.刪除分支
1).刪除本地分支
git branch -D branch_name
2).刪除遠程分支
git push orgin :branch_name
3.切換分支
git checkout branch_name
4.將本地分支分布到服務端
git push orgin branch_name
5. 把本地代碼推送到遠程倉庫
1). 先進行本地倉庫初始化 git init
2). 提交代碼到本地倉庫 ?git commit .
3). 添加遠程倉庫地址 git remote (alais name) (remoteUrl) eg:git remote remote_rep?https://git.oschina.net/xxx.git
4). 推送數據到遠程倉庫 git push -u (alais name) (branch name)
eg: git push -u remote_rep master
Ps:默認新倉庫分支名稱是master,一般都是會重復 請使用其他名字; -u 必須添加?
?
轉載于:https://www.cnblogs.com/lyzblog/p/4689166.html
總結
以上是生活随笔為你收集整理的用到的 git 命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LeetCode Reverse Li
- 下一篇: 输入一个正整数,求它各位数的数字之和