git 命令的使用(一) add commit push pull
一. commit 和 push 的区别
git作为支持分布式版本管理的工具,它管理的库(repository)分为本地库、远程库。
git commit操作的是本地库,git push操作的是远程库。
git commit是将本地修改过的文件提交到本地库中。
git push是将本地库中的最新信息发送给远程库。
git pull命令的作用是,取回远程主机某个分支的更新,再与本地的指定分支合并。它的完整格式稍稍有点复杂。
git pull = git fetch + git merge
注:git add之前,应该先git pull一下;git add 后面是空文件夹的话,添加不上
[ch@1httg6tZ crawler]$ cd wcg
[ch@1httg6tZ wcg]$ ls
test2.py test.py
[ch@1httg6tZ wcg]$ vim test1.py #把刚创建的文件添加到git
[ch@1httg6tZ wcg]$ git add test1.py #添加文件
[ch@1httg6tZ wcg]$ git commit -m 'add new file' #将本地修改的文件提交到本地库中
[master 65ae9e8] add new file
file changed, insertion(+)
create mode wcg/test1.py
[ch@1httg6tZ wcg]$ git push #把本地保存的信息发送到服务器里面
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git) Password for 'https://chenguang@123.56.178.186:8443':
Counting objects: , done.
Delta compression using up to threads.
Compressing objects: % (/), done.
Writing objects: % (/), bytes | bytes/s, done.
Total (delta ), reused (delta )
remote: Resolving deltas: % (/)
remote: Updating references: % (/)
To https://chenguang@123.56.178.186:8443/r/crawler.git
c0c026f..65ae9e8 master -> master
[ch@1httg6tZ wcg]$ git pull
Password for 'https://chenguang@123.56.178.186:8443':
Already up-to-date.
[ch@1httg6tZ wcg]$
git 命令的使用(一) add commit push pull的更多相关文章
- 2.每人自己建立一个HelloWorld项目,练习使用git的add/commit/push/pull/fetch/clone等基本命令。比较项目的新旧版本的差别。答题人:张立鹏
第1步:创建SSH Key.在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有id_rsa和id_rsa.pub这两个文件,如果已经有了,可直接跳到下一步.如果没有,打开Shell ...
- 第二章-如何使用github建立一个HelloWorld项目,git的add/commit/push/pull/fetch/clone等基本命令用法。--答题人:杨宇杰
1.配置Git 首先在本地创建ssh 秘钥:在git bash输入: $ ssh-keygen -t rsa -C "your_email@youremail.com" eg:$ ...
- 第二章——建立一个HelloWorld项目,练习使用git的add/commit/push/pull/fetch/clone等基本命令。比较项目的新旧版本的差别-----答题者:徐潇瑞
1.首先下载安装git,很简单所以就不详细说了,当弹出一个类似的命令窗口的东西,就说明Git安装成功 2.因为Git是分布式版本控制系统,所以需要填写用户名和邮箱作为一个标识 3.接着,注册githu ...
- Git CMD连接,管理(remote,add,commit,push)github repository
git initmd testcd testgit statusgit add test //git add test/a.txtgit status git remote add origin g ...
- 【记录】gitLab git命令add commit fetch pull push
最近项目使用git进行版本控制,由于之前用svn,所以对git不是太熟悉,网上一通乱找git各命令含义, 以下内容感觉讲的很详细,可以很清楚理解git提交流程,博主把重要的信息用红字标注了,更加显眼. ...
- git最基本的操作: add commit push 哈哈
Git add //添加到本地暂存区 Git commit -m”xxxxx” //添加到本地分支 Git push //添加到远端分支
- 09_EGIT插件的安装,Eclipse中克隆(clone),commit,push,pull操作演示
1 下载EGIT,下载地址:http://www.eclipse.org/egit/download/ 最终的下载地址: http://www.eclipse.org/downloads/dow ...
- Mac常用基本命令/常用Git命令
Git地址: https://github.com/mancongiOS/command-line基本命令 目录/文件的操作 mkdir "目录名" 在当前路径下创建一个文件夹 m ...
- 【3】Git命令
个人推荐的Git知识学习网站:https://git-scm.com . git常用操作图 init -> add -> commit -> remote -> push 初始 ...
随机推荐
- 课堂所讲整理:HTML--5JavaScript简介
一.JavaScript简介 1.JavaScript是个什么东西? 它是个脚本语言,需要有宿主文件,它的宿主文件是HTML文件. 2.它与Java什么关系? 没有什么直接的联系,Java是Sun公司 ...
- HMTL—表单
<body> <form> 账号:<input type="text" value="123" /> <br /> ...
- Java Debugging
1, https://visualvm.java.net/oqlhelp.html#top http://docs.oracle.com/javase/7/docs/technotes/samples ...
- network Driver , TDI(Transport Driver Interface) Drivers
https://msdn.microsoft.com/en-us/library/windows/hardware/ff565094(v=vs.85).aspx https://msdn.micros ...
- premiere视频输出参数设置
- 使得<li>在一行显示,去除浮动的方法
①<li>使用浮动的方法,但是要用div包裹起来,该父元素需要设置宽度与高度: <!DOCTYPE html> <html> <head> <me ...
- 安装SQL Server驱动到Maven仓库[转]
from:http://raysen.blog.51cto.com/324335/1159232 Maven does not directly support some libraries, lik ...
- ExtJs学习笔记之ComboBox组件
ComboBox组件 (1)ComboBox控件支持自动完成.远程加载.和许多其他特性. (2)ComboBox就像是传统的HTML文本 <input> 域和 <select> ...
- jQuery图片无缝滚动JS代码ul/li结构
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- [Hibernate] - Study 1
1)解压Hibernate,在eclipse中导入jar包,其中lib\required里的jar包是必需包括在里头的.这里用的是sql server,所以要导入sqljdbc4.jar 2)在src ...