User Tools

Site Tools


dev:kb:version_control

Version Control System

Perforce

Official p4 document

Add files and edit

p4 add [-c changelist#] <filename>

Checkout files and edit

p4 edit [-c changelist#] <filename>

Edit a changelist description(Add/remove files)

p4 change changelist#

Move file to another changelist

p4 reopen [-c changelist#] file

Discard changes from an opened file

p4 revert file 

Delete a changelist

p4 revert -c changelist# //...
p4 change -d changelist#

Create a changelist from default changelist

p4 change

See pending/submitted changes

p4 changes -u $P4USER -c $P4CLIENT -s $STATUS(pending, submitted, shelved)

See the latest change in current directory local have

p4 changes -m1 ...#have

See the latest change in current directory server have

p4 changes -m1 ...

Check-in change

p4 submit -c changelist#

Shelve a change

p4 shelve -r -c changelist#

Discard the shelved files

p4 shelve -d -c changelist#

Unshelve a change

p4 unshelve -s shelvelist# [-c changelist#] [file]

Displays full information about a single changelist

p4 describe changelist#

Lists files currently opened in pending changelists

p4 opened

Add directory recursively to perforce depot

# In Windows
dir /b /s /a-d | p4 -x – add
# In Linux/Unix
find . -type f -print | p4 -x - add
# In Mac
files -f -q -r -s | p4 -x - add

Git

GUI client

  • gitk - graphical history browser, in Tcl/Tk, distributed with Git (usually in gitk package)
  • git gui - graphical commit tool, in Tcl/Tk, distributed with Git (usually in git-gui package)
  • QGit - uses Qt toolkit
  • Giggle - uses GTK+ toolkit
  • git-cola - uses PyQt4
  • gitg - GTK+/GNOME clone of GitX
  • tig - text mode interface for git, is GUI and pager, uses ncurses
  • GitForce Git tool with Graphical user interface, available under GNU GPL license

Git clone specified branch

git clone {URL} -b master

Git switch branch

git checkout dev

Git delete local branch

git branch -d test_branch

Git delete remote branch

git push origin :test_branch

Git push branch to remote

git push -u origin new_branch

SVN

dev/kb/version_control.txt · Last modified: 2020/06/06 23:32 by 127.0.0.1