(this assumes that you’re comfortable with some knowledge of github, git, and using linux).
I’ve been using mapbox’s mapbox-studio (previously known as tm2) and while it was going rapid development, I was tired of doing updating it (by using git ) nd reinstalling it, so
I made a bash alias (alias is a shortcut that you make in linux for your command line) to pull updates from mapbox’s mapbox-studio to my local fork, delete the node_modules as mapbox suggests, pull the newest changes from mapbox (upstream) on github, then reinstall mapbox-studio through npm.
here’s the alias, 3 commands that are instructed to run after the first one is completed:
alias udtm2='cd ~/prg/tm2/ rm -rf ~/prg/tm2/node_modules && git pull upstream mb-pages && npm install'
(by using the && after a command, the second following command won’t run until the first is completed! neato trick!)
Within the past couple weeks, mapbox renamed the repository from tm2 to mapbox-studio and they also switched the default branch from master to mb-pages.
So, when I ran my bash alias this morning: I received this error:
fatal: Couldn’t find remote ref master
So, I fixed my bash alias by doing 2 things:
1] First, I went into the .git folder within my local repo,
Edited the text that said and replaced master with mb-pages in both places.
remote = origin
merge = refs/heads/master
2] Updated my alias.
You can simply update an alias by
alias udtm2=’rm -rf ~/prg/tm2/node_modules && git pull upstream mb-pages && npm install’
Now, I can update my mapbox-studio by a simple command, udtm2 :)