開発

Bitbucketでpullしてみる


AWSのサーバの変更をローカルのPCでpullしてみる。逆も基本的に同じ。

変更確認用のファイルを作って
$ vi pulltest.txt
$ ls -a
. .. .git README.md README.text pulltest.txt sample.html sandbucket.jpg text.txt

git addしてcommitして、pushします。
$ git add .
$ git commit -m "pullをしてみよう"
[master dfb5741] pullをしてみよう
Committer: EC2 Default User
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

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 file changed, 1 insertion(+)
create mode 100644 pulltest.txt
$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch 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)

Password for 'https://kazsoga@bitbucket.org':
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 349 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To https://kazsoga@bitbucket.org/kazsoga/tutorial.git
a3133cc..dfb5741 master -> master
$ ls -a
. .. .git README.md README.text pulltest.txt sample.html sandbucket.jpg text.txt

Bitbucket側。
スクリーンショット 2015-07-02 23.16.03

でローカルのPCでpull。

$ git pull
Password for 'https://kazsoga@bitbucket.org':
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://bitbucket.org/kazsoga/tutorial
a3133cc..dfb5741 master -> origin/master
Updating a3133cc..dfb5741
Fast-forward
pulltest.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 pulltest.txt
sogakazuhiro-no-iMac:tutorial sogakazuhiro$ ls -a
. .git README.text sample.html text.txt
.. README.md pulltest.txt sandbucket.jpg

問題なくできました。githubと手順は一緒ですね。