git一键提交修改文件

git一键提交修改文件

 首先安装git, 有git bash; 新建一个gitcmt文件,放置于与你的项目同级的目录里;

使用:打开git bash,

方法1. git pullgit status ../gitcmt "mycommit"(提交备注);依次输入三条命令;

方法2. git pullgit status gitcmt "mycommit"(提交备注); 前提把gitcmt文件所在路径加入到环境变量的path路径里,提交时依次输入即可。

gitcmt文件

文件名:gitcmt

内容:

#!/bin/bash
currDir=$(pwd)
remark=$1
if [ ${remark}x = ""x ];then
remark=$(date +"%Y-%m-%d %H:%M:%S")
fi
echo ${currDir}
git add .
git commit -m ""${remark}""
git push

至此一键提交修改文件已完毕;

git 常用命令行:

git pull

git add .

git status

git commit -m"修改"

git push origin master

git diff

git remote -v 查看remote信息

如何使用git创建项目,创建分支 http://www.cnblogs.com/alice-fee/p/6106064.html

原文地址:https://www.cnblogs.com/alice-fee/p/6511185.html