Last active
September 7, 2021 13:01
-
-
Save omkz/712c810a1e9bc9eaf14254cfe68f1abe to your computer and use it in GitHub Desktop.
git pull all branches from remote repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the main command is: | |
``` | |
for branch in `git branch -r | cut -d '/' -f2` ; do git checkout $branch && git pull origin $branch ; done | |
``` | |
check branch yang sudah ada: | |
``` | |
git branch -a | |
``` | |
➜ stripe-basics git:(master) git branch -a | |
* master | |
remotes/origin/HEAD -> origin/master | |
remotes/origin/cards | |
remotes/origin/checkout | |
remotes/origin/coupons | |
remotes/origin/master | |
remotes/origin/recurring | |
``` | |
➜ stripe-basics git:(master) for branch in `git branch -r | cut -d '/' -f2` ; do git checkout $branch && git pull origin $branch ; done | |
``` | |
Your branch is up-to-date with 'origin/master'. | |
From https://github.com/gotealeaf/stripe-basics | |
* branch HEAD -> FETCH_HEAD | |
Already up-to-date. | |
error: unknown switch '>' | |
usage: git checkout [<options>] <branch> | |
or: git checkout [<options>] [<branch>] -- <file>... | |
-q, --quiet suppress progress reporting | |
-b <branch> create and checkout a new branch | |
-B <branch> create/reset and checkout a branch | |
-l create reflog for new branch | |
--detach detach the HEAD at named commit | |
-t, --track set upstream info for new branch | |
--orphan <new-branch> | |
new unparented branch | |
-2, --ours checkout our version for unmerged files | |
-3, --theirs checkout their version for unmerged files | |
-f, --force force checkout (throw away local modifications) | |
-m, --merge perform a 3-way merge with the new branch | |
--overwrite-ignore update ignored files (default) | |
--conflict <style> conflict style (merge or diff3) | |
-p, --patch select hunks interactively | |
--ignore-skip-worktree-bits | |
do not limit pathspecs to sparse entries only | |
--ignore-other-worktrees | |
do not check if another worktree is holding the given ref | |
--progress force progress reporting | |
Note: checking out 'origin'. | |
You are in 'detached HEAD' state. You can look around, make experimental | |
changes and commit them, and you can discard any commits you make in this | |
state without impacting any branches by performing another checkout. | |
If you want to create a new branch to retain commits you create, you may | |
do so (now or later) by using -b with the checkout command again. Example: | |
git checkout -b <new-branch-name> | |
HEAD is now at 8455c78... fixing README | |
fatal: Couldn't find remote ref origin | |
Previous HEAD position was 8455c78... fixing README | |
Branch cards set up to track remote branch cards from origin. | |
Switched to a new branch 'cards' | |
From https://github.com/gotealeaf/stripe-basics | |
* branch cards -> FETCH_HEAD | |
Already up-to-date. | |
Branch checkout set up to track remote branch checkout from origin. | |
Switched to a new branch 'checkout' | |
From https://github.com/gotealeaf/stripe-basics | |
* branch checkout -> FETCH_HEAD | |
Already up-to-date. | |
Branch coupons set up to track remote branch coupons from origin. | |
Switched to a new branch 'coupons' | |
From https://github.com/gotealeaf/stripe-basics | |
* branch coupons -> FETCH_HEAD | |
Already up-to-date. | |
Switched to branch 'master' | |
Your branch is up-to-date with 'origin/master'. | |
From https://github.com/gotealeaf/stripe-basics | |
* branch master -> FETCH_HEAD | |
Already up-to-date. | |
Branch recurring set up to track remote branch recurring from origin. | |
Switched to a new branch 'recurring' | |
From https://github.com/gotealeaf/stripe-basics | |
* branch recurring -> FETCH_HEAD | |
Already up-to-date. | |
➜ stripe-basics git:(recurring) git branch | |
cards | |
checkout | |
coupons | |
master | |
* recurring | |
check hasilnya: | |
➜ stripe-basics git:(recurring) git branch -a | |
cards | |
checkout | |
coupons | |
master | |
* recurring | |
remotes/origin/HEAD -> origin/master | |
remotes/origin/cards | |
remotes/origin/checkout | |
remotes/origin/coupons | |
remotes/origin/master | |
remotes/origin/recurring | |
➜ stripe-basics git:(recurring) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment