|
[root@192 nginx]# git checkout test
Switched to branch 'test'
[root@192 nginx]# touch 10.txt
[root@192 nginx]# git add 10.txt
[root@192 nginx]# git commit -a -m 'add 10.txt'
[test e517336] add 10.txt
Committer: root
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
If the identity used for this commit is wrong, you can fix it with:
git commit --amend --author='Your Name '
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 10.txt
[root@192 nginx]# ls 10.txt
10.txt
[root@192 nginx]# git checkout master
Switched to branch 'master'
[root@192 nginx]# ls 10.txt
ls: cannot access 10.txt: No such file or directory
[root@192 nginx]# git merge test master
Trying simple merge with test
Already up-to-date with master
Merge made by octopus.
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 10.txt
[root@192 nginx]# ls 10.txt
10.txt
[root@192 nginx]# git push origin
Counting objects: 4, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 363 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /var/ngint.git/
8c40602..c66f7c2 master -> master
这时就能在另一个副本,下载最新文件了:
[root@192 nginx]# cd /opt/mynginx/
[root@192 mynginx]# git pull origin
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /var/ngint
8c40602..c66f7c2 master -> origin/master
Updating 8c40602..c66f7c2
Fast-forward
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 10.txt
[root@192 mynginx]#
|
|
|