win系统下git代码批量克隆,批量更新
@REM 根据实际情况设置GIT路径及本地仓库地址 set path=%path%;"D:\Program Files\Git\cmd" set project_path=F:\git-demo set base_url=git@172.13.15.10:group/ @REM 克隆代码:注释 cd /d %project_path% git clone %base_url%/demo.git @REM 更新代码:注释 cd /d %project_path%\demo git fetch --all git reset --hard origin/master git pull
其他常用命令:
添加本地:git add *
提交本地:git commit -m '注释'
推送远程:git push origin master
创建分支:git branch branch_name
分支切换:git checkout branch_name
创建斌切换:git checkout -b branch_name
合并代码:git merge branch_name