Reputation: 192
folks,
I'll give you a brief description of my problem. I have an Angular App in a TFS Git repository, now I want to build this app with Azure DevOps, when that's done, I want to create a new Git Branch from Master
The build process runs smoothly, only creating a new branch is not possible. Can you help me ?
I try it with a Powershell Script like
git branch [aNewBranch] master
or
git checkout -q [aNewBranch]
but it don't work.
Upvotes: 0
Views: 1412
Reputation: 5531
I am guessing you need a branch from your master branch [with all changes as iin master branch].
Do these steps.
Just check the logs
git log --oneline -10
Fetch everything from repo
git fetch origin [or any remote name]
Keep checking the logs
git log --oneline -10
go to master branch
git checkout master
if master branch does not exists in your local machine -
create it with : git checkout -b master
Now you are in master branch.
rebase with master branch
git rebase origin/master
If you have some code changes already done in master branch (I am guessing the changes are not committed) -
git commit -am "Commit message here.. for your changes" [params : a for all, m for message]
Keep checking the logs
git log --oneline -10
Currently you are in master with new changes [with new commit]
Now go to new branch with changes [as it is in master - I guess this is what you expect]
git checkout -b NewBranch
Keep checking the logs
git log --oneline -10
Upvotes: 1