Perforce and Git handle file edition and change management in a different order.
checkout
the files you want to work on. In particular, it gives write permissions and open them in a pending changelist
.$ p4 edit (aka "Checkout")
Moreover, to have to add
new files in a changelist:
$ p4 add
NOTE
You may use Perforce more like Git (see below) by setting the "allwrite" option to your workspace. In this case, you'll reconcile your changes and use a safe sync (p4 sync -s
or the aliasp4 status
).
(image source: atlassian.com)
1) Unlike Perforce, you just start editing any files you want
2) At any moment, you can stage
a change related to a feature. The git staging area
fulfills the same purpose as a Perforce pending changelist
. They are both places where you group changes together before submission. You'll learn much more about staging in the next courses.
$ git add <files or lines of code>
New files in your working directory
are seen as untracked
by git. You add them the same way.
- Perforce
checkout
vs gitadd
- Perforce
pending changelist
vs gitstaging area
- The edition workflow has a different order