git 常用命令

218 阅读1分钟

安装 git

进入项目目录,右键 Git Bash Here 

# 初始化代码仓库
git init

# 查看状态信息
git status

# 克隆远程仓库
git clone https://github.com/Venthanx/Weather.git

# 把需要提交的所有修改放到暂存区(Stage)
git add .

# 提交代码
git commit -m '备注信息'

# 推送数据到远程仓库 默认使用origin和master
# 把本地仓库push到github上面 此步骤需要你输入帐号和密码
# 第一次push需要加上-u 之后就不需要了

git push 
git push -u origin master


------

# git查看tag的命令
git tag

# 创建tag
git tag tagName –m "注释" 

# 更新推送
git push origin tagName