在Perforce的,我怎么回复我已经发了文件的变化?如何在Perforce中恢复文件?
$ p4 status
UI\FormMain.cs - reconcile to edit //UI/FormMain.cs#73
$ p4 revert UI/FormMain.cs
UI/FormMain.cs - file(s) not opened on this client.
在Git中我做这个用命令git checkout
。
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: Form.cs
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout Form.cs
$ git status
# On branch master
nothing to commit, working directory clean
通常Perforce的工作流程是为编辑明确打开的文件*第一*通过'P4 edit'触摸文件之前(否则服务器将不知道,当你试着去'P4 revert'不会做任何事情)。如果你遵循这种做法,事情会更顺利。 – jamesdlin