Skip to main content
Bumped by Community user
Tweeted twitter.com/#!/StackCodeReview/status/575813578520920064
added 74 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Git merge script - improvements

Update

Output from above:

+ git status
HEAD detached from origin/test-passed
nothing to commit, working directory clean
+ git reset --hard
HEAD is now at 16a2d8d updated version
+ git pull origin test
From ssh://github.com/myrepo.git
 * branch            test       -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test
HEAD is now at 16a2d8d... updated version
+ git pull origin test-passed
From ssh://github.com/myrepo.git
 * branch            test-passed -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test-passed
Previous HEAD position was 16a2d8d... updated version
HEAD is now at 2aa260d... Merge branch 'dev-integration' into test
+ git merge origin/test
Updating 2aa260d..16a2d8d
Fast-forward
 app/application.properties                                     | 8 ++++----           
 4 files changed, 14 insertions(+), 5 deletions(-)
+ git push origin HEAD:test-passed
To ssh://[email protected]/myrepo.git
   2aa260d..16a2d8d  HEAD -> test-passed
+ git status
HEAD detached from origin/test-passed
nothing to commit, working directory clean
+ git reset --hard
HEAD is now at 16a2d8d updated version
+ git pull origin test
From ssh://github.com/myrepo.git
 * branch            test       -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test
HEAD is now at 16a2d8d... updated version
+ git pull origin test-passed
From ssh://github.com/myrepo.git
 * branch            test-passed -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test-passed
Previous HEAD position was 16a2d8d... updated version
HEAD is now at 2aa260d... Merge branch 'dev-integration' into test
+ git merge origin/test
Updating 2aa260d..16a2d8d
Fast-forward
 app/application.properties                                     | 8 ++++----           
 4 files changed, 14 insertions(+), 5 deletions(-)
+ git push origin HEAD:test-passed
To ssh://[email protected]/myrepo.git
   2aa260d..16a2d8d  HEAD -> test-passed

Git merge script - improvements

Update

Output from above:

+ git status
HEAD detached from origin/test-passed
nothing to commit, working directory clean
+ git reset --hard
HEAD is now at 16a2d8d updated version
+ git pull origin test
From ssh://github.com/myrepo.git
 * branch            test       -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test
HEAD is now at 16a2d8d... updated version
+ git pull origin test-passed
From ssh://github.com/myrepo.git
 * branch            test-passed -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test-passed
Previous HEAD position was 16a2d8d... updated version
HEAD is now at 2aa260d... Merge branch 'dev-integration' into test
+ git merge origin/test
Updating 2aa260d..16a2d8d
Fast-forward
 app/application.properties                                     | 8 ++++----           
 4 files changed, 14 insertions(+), 5 deletions(-)
+ git push origin HEAD:test-passed
To ssh://[email protected]/myrepo.git
   2aa260d..16a2d8d  HEAD -> test-passed

Git merge script

Output from above:

+ git status
HEAD detached from origin/test-passed
nothing to commit, working directory clean
+ git reset --hard
HEAD is now at 16a2d8d updated version
+ git pull origin test
From ssh://github.com/myrepo.git
 * branch            test       -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test
HEAD is now at 16a2d8d... updated version
+ git pull origin test-passed
From ssh://github.com/myrepo.git
 * branch            test-passed -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test-passed
Previous HEAD position was 16a2d8d... updated version
HEAD is now at 2aa260d... Merge branch 'dev-integration' into test
+ git merge origin/test
Updating 2aa260d..16a2d8d
Fast-forward
 app/application.properties                                     | 8 ++++----           
 4 files changed, 14 insertions(+), 5 deletions(-)
+ git push origin HEAD:test-passed
To ssh://[email protected]/myrepo.git
   2aa260d..16a2d8d  HEAD -> test-passed
added 1141 characters in body
Source Link
latusaki
  • 251
  • 2
  • 7

The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complete.

git status
git reset --hard
git pull origin test
git checkout origin/test
git pull origin test-passed
git checkout origin/test-passed
git merge origin/test
git push origin HEAD:test-passed

One specific question I have, is if I need to create local branches as wewell (-b) or is that not required?

Update

Output from above:

+ git status
HEAD detached from origin/test-passed
nothing to commit, working directory clean
+ git reset --hard
HEAD is now at 16a2d8d updated version
+ git pull origin test
From ssh://github.com/myrepo.git
 * branch            test       -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test
HEAD is now at 16a2d8d... updated version
+ git pull origin test-passed
From ssh://github.com/myrepo.git
 * branch            test-passed -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test-passed
Previous HEAD position was 16a2d8d... updated version
HEAD is now at 2aa260d... Merge branch 'dev-integration' into test
+ git merge origin/test
Updating 2aa260d..16a2d8d
Fast-forward
 app/application.properties                                     | 8 ++++----           
 4 files changed, 14 insertions(+), 5 deletions(-)
+ git push origin HEAD:test-passed
To ssh://[email protected]/myrepo.git
   2aa260d..16a2d8d  HEAD -> test-passed

The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complete.

git status
git reset --hard
git pull origin test
git checkout origin/test
git pull origin test-passed
git checkout origin/test-passed
git merge origin/test
git push origin HEAD:test-passed

One specific question I have, is if I need to create local branches as we

The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complete.

git status
git reset --hard
git pull origin test
git checkout origin/test
git pull origin test-passed
git checkout origin/test-passed
git merge origin/test
git push origin HEAD:test-passed

One specific question I have, is if I need to create local branches as well (-b) or is that not required?

Update

Output from above:

+ git status
HEAD detached from origin/test-passed
nothing to commit, working directory clean
+ git reset --hard
HEAD is now at 16a2d8d updated version
+ git pull origin test
From ssh://github.com/myrepo.git
 * branch            test       -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test
HEAD is now at 16a2d8d... updated version
+ git pull origin test-passed
From ssh://github.com/myrepo.git
 * branch            test-passed -> FETCH_HEAD
Already up-to-date.
+ git checkout origin/test-passed
Previous HEAD position was 16a2d8d... updated version
HEAD is now at 2aa260d... Merge branch 'dev-integration' into test
+ git merge origin/test
Updating 2aa260d..16a2d8d
Fast-forward
 app/application.properties                                     | 8 ++++----           
 4 files changed, 14 insertions(+), 5 deletions(-)
+ git push origin HEAD:test-passed
To ssh://[email protected]/myrepo.git
   2aa260d..16a2d8d  HEAD -> test-passed
added 32 characters in body
Source Link
RubberDuck
  • 31.2k
  • 6
  • 74
  • 177

The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complete.

git status git reset --hard git pull origin test git checkout origin/test git pull origin test-passed git checkout origin/test-passed git merge origin/test git push origin HEAD:test-passed

git status
git reset --hard
git pull origin test
git checkout origin/test
git pull origin test-passed
git checkout origin/test-passed
git merge origin/test
git push origin HEAD:test-passed

One specific question I have, is if I need to create local branches as we

The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complete.

git status git reset --hard git pull origin test git checkout origin/test git pull origin test-passed git checkout origin/test-passed git merge origin/test git push origin HEAD:test-passed

One specific question I have, is if I need to create local branches as we

The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complete.

git status
git reset --hard
git pull origin test
git checkout origin/test
git pull origin test-passed
git checkout origin/test-passed
git merge origin/test
git push origin HEAD:test-passed

One specific question I have, is if I need to create local branches as we

Source Link
latusaki
  • 251
  • 2
  • 7
Loading