In P4V, how do I create a branch from a label? - label

My company just imported our CVS repository into Perforce. I'm new to P4V and I can't work out how to create a branch from an existing label. Can anyone tell me how to do this?

In my copy of P4V (Version 2013.3), I go to the Actions menu and choose Branch Files..., which brings up the Branch Files dialog:
In that dialog, I specify the source files to branch, and the target name of my branch (in my case I am branching //depot/main/... to //depot/branch/...), and in the Filter tab I specify that I want to specify the source revisions using a label.
And I type my label name into the text box (If I don't know the label name I can Browse... for it).
Then I click the Branch button to make the branch.

Related

TFS Create Branch from folder and rename it with one checkin

I have a Folder "$/MyTeamProj/Sources" in TFS with some projects in it.
There is no branch in the team project.
Now I want to create a Branch of this folder with the name "Dev".
When I click on "convert to branch" I cannot change the Branchname.
I don't want to rename it and checkin and afterwards create the branch and checkin again.
I want only one checkin. The branch should keep history from the folder.
Many Thanks in advance
Right click on the folder.
Choose "Bracnhing and Merging".
Don't click on "Convert to branch", click on "Branch...".
In the "Target" type: "$/MyTeamProj/Sources/Dev".
Click OK.

How to create new project with GitHub and Xcode?

When I start a new project with GitHub I always struggle with the same issue. When I create a GitHub project it's already prepopulated with some files (.gitignore, LICENSE, README.md) and hence with an initial commit. I explicitly choose to add these items so I don't have to care about writing them myself.
On the other side, when I start a new Xcode project it works in a very similar way: Xcode creates an initial commit with some files. So when I'm trying to pull my GitHub repo I always have to deal with Git refusing to merge unrelated histories problem.
Is there a correct workflow for this?
Here is the easy way to do this, assuming that you are using a recent Xcode, e.g. 11.2...
create new repository in GitHub, checking .gitignore file and README.md file options
copy repository URL from browser's address field
create new project in Xcode, checking local git repository option
right click Remotes in project's source control navigator to add remote, using URL copied earlier, suffixed with .git
select Fetch and Refresh Status from Source Control menu
select Pull from Source Control menu, from origin/master remote (.gitignore and README.md files are now in your local repository... if in Finder, use Command Shift . to toggle hidden files display)
select Push from Source Control menu, to origin/master remote (Xcode project files are now in your GitHub repository)
Voila! You have set up a new project in Xcode and GitHub in less than a minute.
Just came across the same issue. It actually works on Xcode 11, if you follow these steps:
Create the repository on GitHub including initial branches, License, Readme.md etc.
At the Welcome screen of Xcode choose "Clone an existing project"
Clone your repository into the desired directory (usually a subdirectory of XCodeWorkspaces)
Close Xcode and reopen to get back to the Welcome Screen (that's the trick)
This time choose "Create a new Xcode project"
Place the project into the cloned directory. Xcode automatically picks up, that this directory is already under Git control.
You'll see that the initial files are marked with A and M in the Xcode project navigator
In the menu "Source Control" choose "Commit". You should see all files created by Xcode. Make sure to activate on "Push to remote:" and choose the right branch. Press Commit
If nobody committed or changed on GitHub between step 1 and step 7, it'll work. Check on GitHub.

TFS - How do I clone a project so I can rollback the original?

I have a project in TFS that has been live for a year. In June we made our final release (we labelled the sources) before we began a massive 3 month overhaul during which the live site would not change.
Unfortunately we are now required to make a change to the live site and the codebase has changed significantly. What I want to do ideally is check-out by label the final release (June) into another folder and check that in to TFS to create another project. This way my team can work on both projects.
How can I best achieve this?
You should create a branch. This doesn't need to be in a new project. In fact it would be better if it wasn't, however depending on your folder structure keeping it in the same project might not be an option.
Right click on the root of the folder you want to branch. This should be the folder highest in your folder structure that contains all of the code you want to modify.
On the right click menu select "Branching and Merging" and then "Branch"
Choose a sensible location for the new branch.
In the dropdown select "Label" then choose the appropriate selection.
Hit branch. This will create a new branch from the label and you will be able use the new branch to modify your live code base

Create branch in Versions (Mac Subversion client)

I have search everywhere but I can't find information on how to create a branch in Versions for Mac. How is this done?
There was very little information on this but I found the answer. Just press Option key and drag the trunk into the branches folder
The option key opens the Move dialog and copies the source to the target, then deletes the source. You can Duplicate the project first, then option/drag to Move the duplicate to the branches folder.
A branch or tag is simply a copy of the trunk, or in some cases another folder, in your Subversion repository. To create one, use the “Browse” view to navigate to the right place in your repository and drag the trunk of your project to the “branches” folder while holding down the “Option” (alt) key on your keyboard. When you drop the trunk, a dialog will open asking you to name your new tag or branch.

How can I move a mistakenly placed TFS branch?

I have just branched from Main to v5.0 but I realized that I want to move this branch inside the Release folder.
How should I proceed with TFS 2010?
Thanks.
Simply right-click on your branch in Source Control and select 'Move..'. Set your desired destination path, and commit this change. You should be OK.
I think I 've read somewhere that moving folders & renaming folders shouldn't be done in separate steps, so if you plan to also rename your branch, do this in a next step.Once you 're done, you should check that with right-clicking MAIN > "branching and merging" > "merge..." you have a target branch to your moved/renamed branch.

Resources