# git_test **Repository Path**: devnobug/git_test ## Basic Information - **Project Name**: git_test - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-28 - **Last Updated**: 2024-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GIT常用命令 ## 配置命令 1. 配置用户名:git config --global user.name 提交人姓名 2. 配置邮箱:git config --global user.email 提交人邮箱 3. 查看配置:git config –list –global ## 本地操作 1. 初始化(只执行一次):git init 2. 查看状态:git status 3. 添加到暂存区: git add . 4. 提交到本地仓库: git commit -m “备注信息” 5. 查看日志: git log ​ git reflog ## 远程操作 1. 给远程仓库起别名:git remote add 别名 远程仓库地址 2. 推送代码:git push -u 远程仓库地址 分支名称 第一次推送的时候需要加-u选项,后续只需要`git push` 3. 拉取代码:git pull 别名 分支名称 如果之前保存的有默认远程仓库,也可以直接`git pull`拉取最新代码 1. 克隆代码:git clone 远程仓库地址