一鲫忍、新建git項(xiàng)目常用命令
git init //初始化,會(huì)在項(xiàng)目根目錄生成一個(gè)隱藏的.git文件夾
git status //查看項(xiàng)目文件狀態(tài)
git add . //提交到本地倉儲(chǔ)
git commit -m "描述描述" // 提交到分支
git remote add origin https://gitee.com/..... //設(shè)置好提交地址
git remote -v //查看遠(yuǎn)程倉庫地址
git push -u origin master //發(fā)布到遠(yuǎn)程倉庫的master,即遠(yuǎn)程倉儲(chǔ)
git push //提交到遠(yuǎn)程倉庫
git pull //拉取遠(yuǎn)程倉庫
git helper -a // 查看全部git子命令
二、常用操作命令
//顯示全部分支
git branch //顯示本地分支
git branch -a //顯示遠(yuǎn)程分支
//創(chuàng)建分支
git branch 分支名
git checkout 分支名
//創(chuàng)建分支并切換到創(chuàng)建的分支
git checkout -b 分支名
//發(fā)布到遠(yuǎn)程倉庫的dev分支,即遠(yuǎn)程倉儲(chǔ)
git push origin dev
//刪除分支
//-d 當(dāng)分支已經(jīng)合并到主干后刪除
//-D無論如何都刪除分支
git branch -d 分支名
三鸠儿、遠(yuǎn)程倉庫
//增加了遠(yuǎn)程倉庫abc
git remote add origin git://127.0.0.1/abc.git
//移除遠(yuǎn)程倉庫
git remote remove origin