gggggds 发表于 2019-2-19 12:01:40

git for windows

  说下git bash here 的使用方法

下载地址 https://gitforwindows.org/
git for windows 是开源的,上传代码到gitlab ,github 非常好用的一款软件
  使用方法:
首先创建一个文件夹,右键   
http://i2.运维网.com/images/blog/201808/28/4b5b2ec5966f1be3d6a137bf1891098f.png
http://i2.运维网.com/images/blog/201808/28/50856bfc484641143cb2a8fd0c950fad.png
类似于linux下的操作
  1.接下来要绑定用户名和邮箱

git config --global user.name”用户名(建议是英文)”
git config --global user.email”邮箱地址”
  2.创建一个新的仓库(如果本地没有创建,可以从远程克隆一个到本地)
克隆:git clone ssh://git@...................git
gitlab两种链接方式http,ssh   建议用http,如果用ssh可能会报错,无法解析地址的问题
我在本地创建了一个新库
http://i2.运维网.com/images/blog/201808/28/664b75861b5ce55d69d8c3ac6721d944.png
3.把要上传的代码放到该文件夹下
增加一个远程服务器端:
git remote add origin ssh://git.................git
http://i2.运维网.com/images/blog/201808/28/d3a75d7d3ac0baa9d314a1242e3b58f6.png
4.提交文件到暂存区:
gitadd   文件名/工程名   //如果将文件下的所有内容上传后面   .
http://i2.运维网.com/images/blog/201808/28/125ecac57afcfc6bdf01603781c246e7.png
5.理解提交暂存区文件:
gitcommit -m ""      //"" 里面输入的是本次上传的说明
http://i2.运维网.com/images/blog/201808/28/6e9fd9a8f1ff9de640b543f0915828e3.png
不报错的话应该是这样
http://i2.运维网.com/images/blog/201808/28/5348d54bf5c145dff1acc0e72cfb641e.png
6.将本地主分支推到远程:
git push -u originmaster
http://i2.运维网.com/images/blog/201808/28/e3700eb507a55648ac90c5545587b490.png



页: [1]
查看完整版本: git for windows