這兩天由于在下載一個linux系統(tǒng)下的c#內核支持插件,git 命令下載,死活就下不下來
git clone --recursive?
git clone --recursive https://github.com/zabirauf/icsharp.git
git clone git_repo_address 獲取代碼到本地
git config --list 檢查已有的配置信息
git status 查看本地workspace
git add filename 添加文件到暫存區(qū)
commit filename -m"commit message"
git branch 查看本地分支
git branch -r 查看遠程分支
git checkout branchname 創(chuàng)建本地分支
git checkout -b branchname 創(chuàng)建并切換至本地分支
git checkout -b branchname origin/remote_branchname 創(chuàng)建本地分支并與遠程分支關聯(lián)
git push origin local_branchname:remote_branchname 推送本地分支代碼至遠端分支
git branch -d branchname 刪除本地分支
git tag -a tagname commitid -m"create message"? 打tag
git log 日志相關
git log --pretty=oneline (每個提交在一行顯示)
git log --pretty=short (log顯示commit id 修改者,備注)
git log --pretty=format:"%H - %an" (自定義日志輸出格式)
還原相關?
git reset commit_id(git reset filename)
git add .
git reset --hard? 回退到上次提交版本
git reset --mixed 放棄本次提交(未提交狀態(tài))