1 Star 2 Fork 1

Neil-鹏 / tutorial

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
git.sh 1000 Bytes
一键复制 编辑 原始数据 按行查看 历史
Neil-鹏 提交于 2020-11-21 14:47 . modify
#!/bin/bash
# define dir variable get workdir
dir=`pwd`
# in workdir
cd $dir
git add .
# 提示输入提交信息
echo -n "input commit message:"
read input_msg
# 开始提交代码
git commit -a -m "$input_msg"
git pull
git push
# 同时推送到github
git push github
git push mygit
echo "git commit and push success"
# 添加多个git仓库
# git remote add github url
# 推送到指定的git
# git push github
# 添加文件后需要在终端给脚本文件执行权限
# chmod 777 git.sh
# 1. 预览将要删除的文件
# git rm -r -n --cached 文件/文件夹名称
# 加上 -n 这个参数,执行命令时,是不会删除任何文件,而是展示此命令要删除的文件列表预览。
# 2. 确定无误后删除文件
# git rm -r --cached 文件/文件夹名称
# 3. 提交到本地并推送到远程服务器
# git commit -m "提交说明"
# git push origin master
# 4. 修改本地 .gitignore 文件 并提交
# git commit -m "提交说明"
# git push origin master
1
https://gitee.com/shaipe/tutorial.git
git@gitee.com:shaipe/tutorial.git
shaipe
tutorial
tutorial
master

搜索帮助