首页 > 其他 > 详细

git只提交修改部分的代码

时间:2019-10-29 11:35:43      阅读:406      评论:0      收藏:0      [点我收藏+]

思路:

先用git status 查找出哪些文件被修改过了,然后 只git commit odin/code/pom.xml 


 

1、

$ git status (查看当前更改的代码)

On branch master
Your branch is up to date with ‘origin/master‘.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   odin/code/pom.xml

 

faith@faith_java-PC MINGW64 /d/aa/testcommit/vvv/odin (master)

2.

$ git pull (拉取最新代码)

Already up to date.

faith@faith_java-PC MINGW64 /d/aa/testcommit/vvv/odin (master)

 

3.

$ git commit   odin/code/pom.xml   -m   "test commit" (提交部分代码加备注)

[master f0e1185] test commit
 1 file changed, 1 insertion(+), 1 deletion(-)


faith@faith_java-PC MINGW64 /d/aa/testcommit/vvv/odin (master)

 

4.

$ git push origin master (推送到远程服务器)

Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 439 bytes | 439.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To github.com:zhangjq520/zjq_gitlib_code
   2bd7ce0..f0e1185  master -> master

 

git只提交修改部分的代码

原文:https://www.cnblogs.com/mmzuo-798/p/11757337.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!