創(chuàng)建本地分支:git branch? <分支名>,例如:git? branch newbranch
切換分支:git checkout <分支名>,例如:git checkout newbranch
創(chuàng)建并切換分支:git checkout -b <分支名>,例如:git checkout -b?newbranch
創(chuàng)建遠(yuǎn)程分支:git push -u origin <分支名>,將本地dev分支推送至遠(yuǎn)程
查看本地分支:git branch ---當(dāng)前分支前面會(huì)標(biāo)一個(gè)*號
查看分支詳情:git branch -av
查看遠(yuǎn)程分支:git branch -r?
合并分支:git merge <分支名>,例如:git merge?newbranch
刪除分支:git branch -d <分支名>,例如:git branch -d newbranch
強(qiáng)行刪除分支:git branch -D <分支名>,例如:git branch -D?newbranch---刪除一個(gè)沒有被合并過的分支
查看分支合并圖:git log --graph
查看遠(yuǎn)程庫信息:git remote,git remote -v