Permalink
Browse files

Fetch/reset instead of git pull

git pull has potential for merge conflicts and other problems in the
background. Since we're never pushing from concrete's repo, we're safe
to do a fetch/reset --hard. This will ensure we're always getting
updated to the correct point with no issues.
  • Loading branch information...
1 parent efd58a5 commit f6acc309f62b397eaf60b5b8ec4192694c6cf5a9 @joefiorini joefiorini committed Jun 21, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 lib/git.js
  2. +1 −1 src/git.coffee
View
3 lib/git.js
@@ -36,8 +36,9 @@
jobs = require('./jobs');
out = "Pulling '" + git.branch + "' branch";
return jobs.updateLog(jobs.current, out, function() {
+ var _this = this;
console.log(out.grey);
- return exec('git pull origin ' + git.branch, __bind(function(error, stdout, stderr) {
+ return exec('git fetch && git reset --hard origin/' + git.branch, function(error, stdout, stderr) {
if (error != null) {
out = "" + error;
jobs.updateLog(jobs.current, out);
View
2 src/git.coffee
@@ -53,7 +53,7 @@ git = module.exports =
out = "Pulling '#{git.branch}' branch"
jobs.updateLog jobs.current, out, ->
console.log out.grey
- exec 'git pull origin ' + git.branch, (error, stdout, stderr)=>
+ exec 'git fetch && git reset --hard origin/' + git.branch, (error, stdout, stderr)=>
if error?
out = "#{error}"
jobs.updateLog jobs.current, out

0 comments on commit f6acc30

Please sign in to comment.