Git远程同步本地代码

初次使用git上传代码:

cd ${你的工程代码目录}
git init
git add .
git commit -m 'add xxx'
git remote add origin https://github.com/lcm-linux/test.git  #你的项目地址
git remote -v
git push -u origin master

以下是代码更新后,使用git提交的过程

[root@testserver-1 /data1/ansible]# git add -A
[root@testserver-1 /data1/ansible]# git commit -m 'update manual' 
[master cb9c59a] update manual
 5 files changed, 79 insertions(+), 2 deletions(-)
 create mode 100644 manual/data_shell/pg_backup.sh
 create mode 100644 manual/data_shell/pg_recover.sh
 create mode 100644 "manual/read/apollo\347\216\257\345\242\203\350\277\201\347\247\273\346\223\215\344\275\234\346\211\213\345\206\214.docx"
 delete mode 100644 "manual/word_clouds/\350\257\215\344\272\221\345\256\211\350\243\205\350\257\264\346\230\216.docx"
[root@testserver-1 /data1/ansible]# git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#   (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
[root@testserver-1 /data1/ansible]# git remote -v
origin  git@git.xxx.com:DevOps_yw/K007-ansible.git (fetch)
origin  git@git.xxx.com:DevOps_yw/K007-ansible.git (push)
[root@testserver-1 /data1/ansible]# 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.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 19, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (12/12), 364.01 KiB | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
remote: branchName=master ....begin code check........
To git@git.xxx.com:DevOps_yw/K007-ansible.git
   6b4933d..cb9c59a  master -> master
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值