Giter Club home page Giter Club logo

gitsync's Introduction

Git Sync 同步脚本

这是一个一键脚本, 作用于快捷快速提交合并代码.

缘由:

因本人想推动咱外包公司使用git代替ftp管理代码所写.


建议:

配合vscode处理异常冲突更香哦~


目录:



原理

我用一段伪代码来表示

if (检查文件是否有改动 == TRUE) {
	// 合并更新推送
	git add .
	git commit -m "用户名 update""自定义备注"
	git pull origin ${当前分支}
	git push origin ${当前分支}
} else {
	// 更新本地代码
	git pull origin ${当前分支}
}


操作系统

  • Linux
  • Windows (git bash中使用)


全局安装

任意git仓库目录可用

Linux
  • 克隆到/home/gitsync/, 把目录添加到环境变量
  • 或者直接丢到/usr/local/bin

Windows
  • 复制gitsync.shC:\windows\system32\目录即可


局部安装

只能在项目根目录使用

  • 复制gitsync.sh到项目仓库根目录

使用

懒人方法

直接提交, 免输入提交说明. 默认为 git用户名 update

$ gitsync.sh

自定义提交说明

$ gitsync.sh "更新了README"

gitsync's People

Contributors

edk24 avatar yuxiaobo64 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.