BitBucket - Add to develop branch directly instead of master

前端 未结 1 2098
天命终不由人
天命终不由人 2021-01-16 15:27

We are in the process of changing our SCM to BitBucket. Currently we use Clearcase SCM and there we have code in different stages / streams - Dev, UAT and production, where

相关标签:
1条回答
  • 2021-01-16 15:46

    You don't need to switch to a ClearCase view and initialize your repo there.

    Keep your local Git repo separate, ready to push to its remote repo.

    Each time you want to add a coherent state from ClearCase, stay in your git repo and type:

     git --work-tree=/path/to/ClearCase/view/aVob add .
     git commit -m "Add state from CC view"
     git push
    

    Then change the config spec of the CC view to its next baseline (or full label), in order to represent the next coherent state (since ClearCase is file-based, and has no notion of commits beside an UCM baseline).
    And add again the new content of that same view to your same local Git repo (same branch). And push again.


    My basic question is - If I have set of files that I want to add to develop branch instead of master branch and I did a ‘git init’ -> ‘git add --all’ -> ‘git commit –m “Initial Commit” ‘ -> ‘git remote add origin ssh://ourBBserver.com:7999/EN/apprepo' ,

    First: don't git init. If you have a master branch that means you already initialize a repo somewhere else.

    Go to that repo, create a develop branch and add the content matching the CC view set for that CC develop branch

    cd /path/to/my/repo
    git checkout -b develop
    git --work-tree=/path/to/ClearCase/view/aVob add .
    git commit -m "add content of CC develop branch (no history though)"
    git push -u origin develop
    
    0 讨论(0)
提交回复
热议问题