blob: d27fea5555436644612d9ba9b1e9563611a7aac4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/usr/bin/env bash
# This script refreshes the local repository with the contents of the
# upstream repository. The main usage of this is to pull the
# master branch, and sync git-svn if necessary.
#
# Syntax: git-refresh [all]
. llvm-common
# Update from origin to upstream
safe_run git checkout master
echo " + Fetching origin..."
safe_run git fetch origin
if is_git_svn; then
echo " + Rebasing SVN master..."
safe_run git svn rebase -l
else
echo " + Rebasing master..."
safe_run git pull
fi
# Fetch all other remotes
if [[ $1 = 'all' ]]; then
for remote in `git remote`; do
if [ "$remote" != "origin" ]; then
echo " + Fetching remote $remote..."
safe_run git fetch $remote
fi
done
fi
|