在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