git 修改代码后提交到远端
2015-12-22 10:31
537 查看
注意:
第一: ( git clone url )
第二: 必须跳转到master分支之上进行修改,不是origin/master分支,使用 ( git branch ) 查看分支,使用 ( git checkout $分支 ) 进行分支跳转;
第三:必须在当前分支上,在命令窗口打开要修改的文件;
第四: 修改完代码后,无论是新增或者修改的代码,都必须使用( git add . )进行一次对远程的添加,然后再 ( git commit -m "message" )提交,最后才进行 ( git push )提交到远程;
git使用(二):修改代码并提交修改文件
xiangpingli 2015-1-27 0:37:45 阅读(1638) 评论(0)
修改文件后,如何提交到git服务器?
(1)首先需要add,比如.config是被修改的文件,则
git add .config
(2)然后执行git commit -m "modify .config for some reason"
(3)然后git push 到git服务器
(4)更新:git pull
(5)查看log:git log
如下是全部过程:
root@linux:/study/linux-git/linux-git/linux-3.18.3# git diff
diff --git a/linux-3.18.3/.config b/linux-3.18.3/.config
index b06c025..039c21d 100644
--- a/linux-3.18.3/.config
+++ b/linux-3.18.3/.config
@@ -5877,10 +5877,6 @@ CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_HOST=y
CONFIG_USBIP_DEBUG=y
# CONFIG_USB_MUSB_HDRC is not set
-# CONFIG_USB_MUSB_HOST is not set
-# CONFIG_USB_MUSB_TUSB6010 is not set
-# CONFIG_USB_MUSB_UX500 is not set
-# CONFIG_MUSB_PIO_ONLY is not set
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
diff --git a/linux-3.18.3/arch/x86/configs/baytrail_config b/linux-3.18.3/arch/x86/configs/baytrail_config
index b06c025..039c21d 100644
--- a/linux-3.18.3/arch/x86/configs/baytrail_config
+++ b/linux-3.18.3/arch/x86/configs/baytrail_config
@@ -5877,10 +5877,6 @@ CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_HOST=y
CONFIG_USBIP_DEBUG=y
# CONFIG_USB_MUSB_HDRC is not set
-# CONFIG_USB_MUSB_HOST is not set
-# CONFIG_USB_MUSB_TUSB6010 is not set
-# CONFIG_USB_MUSB_UX500 is not set
-# CONFIG_MUSB_PIO_ONLY is not set
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
root@linux:/study/linux-git/linux-git/linux-3.18.3# git commit -m "modify .config and baytrail_config for compile err"
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
modified: .config
modified: arch/x86/configs/baytrail_config
no changes added to commit
root@linux:/study/linux-git/linux-git/linux-3.18.3# git add .config
root@linux:/study/linux-git/linux-git/linux-3.18.3# git add arch/x86/configs/baytrail_config
root@linux:/study/linux-git/linux-git/linux-3.18.3# git commit -m "modify .config and baytrail_config for compile err"
[master 66a45f9] modify .config and baytrail_config for compile err
2 files changed, 8 deletions(-)
root@linux:/study/linux-git/linux-git/linux-3.18.3#
root@linux:/study/linux-git/linux-git/linux-3.18.3# git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To s
4000
quelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
git@192.168.0.106's password:
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 606 bytes | 0 bytes/s, done.
Total 7 (delta 5), reused 0 (delta 0)
To git@192.168.0.106:/home/prj_git/linux-git.git/
ed83ada..66a45f9 master -> master
root@linux:/study/linux-git/linux-git/linux-3.18.3# git pull
git@192.168.0.106's password:
Already up-to-date.
root@linux:/study/linux-git/linux-git/linux-3.18.3# git log
commit 66a45f9ff41817d5333fb37355d41a7711bae681
Author: linux <linux@192.168.0.106>
Date: Tue Jan 27 00:21:27 2015 +0800
modify .config and baytrail_config for compile err
commit ed83ada1735194cfd4c9baea3f7417ef166247a7
Author: linux <linux@192.168.0.106>
Date: Mon Jan 26 23:23:25 2015 +0800
add .config to git
commit 03d9cc9b4d2c65b2f6b9272ae9bb2aaf772f3a39
Author: linux <linux@192.168.0.106>
Date: Mon Jan 26 23:22:00 2015 +0800
add baytrail_config
commit 6ecdad3d5e682c09108887c5a0fcd884b3f1b84b
Author: linux <linux@192.168.0.106>
Date: Sun Jan 25 23:18:40 2015 +0800
add git-test.txt
commit 1216e0790b45c59916c2ab75be15a6e563d3a540
Author: linux <linux@192.168.0.106>
Date: Sun Jan 25 22:30:59 2015 +0800
git add linux-3.18.3
root@linux:/study/linux-git/linux-git/linux-3.18.3#
root@linux:/study/linux-git/linux-git/linux-3.18.3#
原文链接:http://blog.csdn.net/xiangpingli/article/details/43173113
第一: ( git clone url )
第二: 必须跳转到master分支之上进行修改,不是origin/master分支,使用 ( git branch ) 查看分支,使用 ( git checkout $分支 ) 进行分支跳转;
第三:必须在当前分支上,在命令窗口打开要修改的文件;
第四: 修改完代码后,无论是新增或者修改的代码,都必须使用( git add . )进行一次对远程的添加,然后再 ( git commit -m "message" )提交,最后才进行 ( git push )提交到远程;
git使用(二):修改代码并提交修改文件
xiangpingli 2015-1-27 0:37:45 阅读(1638) 评论(0)
修改文件后,如何提交到git服务器?
(1)首先需要add,比如.config是被修改的文件,则
git add .config
(2)然后执行git commit -m "modify .config for some reason"
(3)然后git push 到git服务器
(4)更新:git pull
(5)查看log:git log
如下是全部过程:
root@linux:/study/linux-git/linux-git/linux-3.18.3# git diff
diff --git a/linux-3.18.3/.config b/linux-3.18.3/.config
index b06c025..039c21d 100644
--- a/linux-3.18.3/.config
+++ b/linux-3.18.3/.config
@@ -5877,10 +5877,6 @@ CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_HOST=y
CONFIG_USBIP_DEBUG=y
# CONFIG_USB_MUSB_HDRC is not set
-# CONFIG_USB_MUSB_HOST is not set
-# CONFIG_USB_MUSB_TUSB6010 is not set
-# CONFIG_USB_MUSB_UX500 is not set
-# CONFIG_MUSB_PIO_ONLY is not set
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
diff --git a/linux-3.18.3/arch/x86/configs/baytrail_config b/linux-3.18.3/arch/x86/configs/baytrail_config
index b06c025..039c21d 100644
--- a/linux-3.18.3/arch/x86/configs/baytrail_config
+++ b/linux-3.18.3/arch/x86/configs/baytrail_config
@@ -5877,10 +5877,6 @@ CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_HOST=y
CONFIG_USBIP_DEBUG=y
# CONFIG_USB_MUSB_HDRC is not set
-# CONFIG_USB_MUSB_HOST is not set
-# CONFIG_USB_MUSB_TUSB6010 is not set
-# CONFIG_USB_MUSB_UX500 is not set
-# CONFIG_MUSB_PIO_ONLY is not set
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
root@linux:/study/linux-git/linux-git/linux-3.18.3# git commit -m "modify .config and baytrail_config for compile err"
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
modified: .config
modified: arch/x86/configs/baytrail_config
no changes added to commit
root@linux:/study/linux-git/linux-git/linux-3.18.3# git add .config
root@linux:/study/linux-git/linux-git/linux-3.18.3# git add arch/x86/configs/baytrail_config
root@linux:/study/linux-git/linux-git/linux-3.18.3# git commit -m "modify .config and baytrail_config for compile err"
[master 66a45f9] modify .config and baytrail_config for compile err
2 files changed, 8 deletions(-)
root@linux:/study/linux-git/linux-git/linux-3.18.3#
root@linux:/study/linux-git/linux-git/linux-3.18.3# git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To s
4000
quelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
git@192.168.0.106's password:
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 606 bytes | 0 bytes/s, done.
Total 7 (delta 5), reused 0 (delta 0)
To git@192.168.0.106:/home/prj_git/linux-git.git/
ed83ada..66a45f9 master -> master
root@linux:/study/linux-git/linux-git/linux-3.18.3# git pull
git@192.168.0.106's password:
Already up-to-date.
root@linux:/study/linux-git/linux-git/linux-3.18.3# git log
commit 66a45f9ff41817d5333fb37355d41a7711bae681
Author: linux <linux@192.168.0.106>
Date: Tue Jan 27 00:21:27 2015 +0800
modify .config and baytrail_config for compile err
commit ed83ada1735194cfd4c9baea3f7417ef166247a7
Author: linux <linux@192.168.0.106>
Date: Mon Jan 26 23:23:25 2015 +0800
add .config to git
commit 03d9cc9b4d2c65b2f6b9272ae9bb2aaf772f3a39
Author: linux <linux@192.168.0.106>
Date: Mon Jan 26 23:22:00 2015 +0800
add baytrail_config
commit 6ecdad3d5e682c09108887c5a0fcd884b3f1b84b
Author: linux <linux@192.168.0.106>
Date: Sun Jan 25 23:18:40 2015 +0800
add git-test.txt
commit 1216e0790b45c59916c2ab75be15a6e563d3a540
Author: linux <linux@192.168.0.106>
Date: Sun Jan 25 22:30:59 2015 +0800
git add linux-3.18.3
root@linux:/study/linux-git/linux-git/linux-3.18.3#
root@linux:/study/linux-git/linux-git/linux-3.18.3#
原文链接:http://blog.csdn.net/xiangpingli/article/details/43173113
相关文章推荐
- Spring学习(四)—— java动态代理(JDK和cglib)
- NDK之java调用C方法
- JDK自带方法实现消息摘要运算
- C# - 冒泡排序算法练手
- ThinkPHP 图片上传接口类
- Eclipse 报java.lang.UnsupportedClassVersionError: ("yourclass") bad major version at offset=6
- Spring启动时注解扫描的问题
- Idea15 常用设置(一):JDK、SVN
- php解析html类库simple_html_dom
- spring mvc使用Maven配置Velocity
- C++标准转换运算符 :reinterpret_cast <new_type> (expression)
- Python控制流语句(if,while,for)
- Spring整合Quartz(JobDetailBean方式)
- JAVA工程师成神之路--基础篇(一)目录
- yii2.0实现验证用户名与邮箱功能
- C++中的运算符重载
- python注意事项
- Spring 主键序列值获取
- Java零基础入门系列10--线程[参考正文顶部目录]
- Win7 搭建 FTP 服务器