Ajmal Afif's blog

Balancing between consuming knowledge and creating values.

Pull and update changes on local repo from updated Github repo

Yesterday I wanted to update my local repo with an updated Github repo made by contributor. I went with my instinct (I thought these things should be instinctive) and failed. Here’s my log:

1
2
3
4
5
$ git pull
$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 2 and 11 different commit(s) each, respectively.
1
2
3
4
5
6
7
8
9
10
11
12
13
$ git add .
$ git merge master
fatal: You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.

$ git ci -m "merged with github"
[master fe7743a] merged with github

$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
nothing to commit (working directory clean)

I am not sure how to rebase my already ahead of 'origin/master' repo. So I did it all over again;

1
2
3
4
$ git fetch origin

$ git reset --hard origin/master
HEAD is now at 8dae4e2 Initial store creation

Success! Only now I have new kind of trouble:

1
2
3
$ rake db:migrate
rake aborted!
FATAL:  database "[repo]_development" does not exist

This is why I’m loving web development. Always learning something new with the infinite amount of invisible walls to break through.

I doubt I’ll be adding much into it soon but to learn by doing, I am trying to at least have an updated copy of the repo on my local so I could start tinkering around with it!

Comments