First, get remote branches up-to-date.
$ git fetch
$ git svn fetch # only if you have Subversion remote repository using git-svn
Show remote branches.
$ git branch -a
Show changes between current local branch and remote branch.
$ git diff remotes/origin/master
Show changes between current local branch and remote branch. (simple)
$ git diff --name-status remotes/origin/master
Show changes between current local branch and remote branch. (simple, Subversion repository)
$ git diff --name-status remotes/svn/trunk
Source: git svn status - showing changes that are not committed to svn - Stack Overflow
I executed Repository.fetch_changesets using script/runner by cron to synchronize repositories of Redline with Git and I got an error below.
git: not found
I modified redmine/lib/redmine/scm/adapters/git_adapter.rb like below and it became OK.
#GIT_BIN = "git"
GIT_BIN = "/usr/local/bin/git"
※ On r4795, r4797, you can set scm_git_command to the path to Git in configuration.yml, so you no longer need such modification like above.
I also encountered an onother problem.
When the user who executes Redmine does not have permission for the Git repository directory (like xxx.git), Redmine shows "The entry or revision was not found in the repository." error on repository page.
$ sudo chmod o+rx xxxx.git
- If the repository is in a user's home directory (e.g. on gitosis or gitolite), you also have to do chmod o+x for the user's home directory.
On Rails-2.1 or later, you can use helper methods outside of views such as in controllers or models like below.
In class level of controllers or in models:
In instance methods of controllers: