User Tools

Site Tools


dev:kb:version_control

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:kb:version_control [2014/05/04 14:15] – [Official p4 document] hackerzhoudev:kb:version_control [2020/06/06 23:32] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Version Control System ====== ====== Version Control System ======
-===== Perforce ====+ 
 +===== Perforce ====
 ==== Official p4 document ==== ==== Official p4 document ====
  
-[[http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.usingp4.html|http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.usingp4.html]]+  * [[http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.usingp4.html|http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.usingp4.html]] 
 +  * [[http://www.perforce.com/perforce/doc.current/manuals/cmdref/index.html|http://www.perforce.com/perforce/doc.current/manuals/cmdref/index.html]]
  
-[[http://www.perforce.com/perforce/doc.current/manuals/cmdref/index.html|http://www.perforce.com/perforce/doc.current/manuals/cmdref/index.html]]+==== Add files and edit ==== 
 +<code> 
 +p4 add [-c changelist#] <filename> 
 +</code>
  
 +==== Checkout files and edit ====
 +<code>
 +p4 edit [-c changelist#] <filename>
 +</code>
  
 +==== Edit a changelist description(Add/remove files) ====
 +<code>
 +p4 change changelist#
 +</code>
 +
 +==== Move file to another changelist ====
 +<code>
 +p4 reopen [-c changelist#] file
 +</code>
 +
 +==== Discard changes from an opened file ====
 +<code>
 +p4 revert file 
 +</code>
 +
 +==== Delete a changelist ====
 +<code>
 +p4 revert -c changelist# //...
 +p4 change -d changelist#
 +</code>
 +
 +==== Create a changelist from default changelist ====
 +<code>
 +p4 change
 +</code>
 +
 +==== See pending/submitted changes ====
 +<code>
 +p4 changes -u $P4USER -c $P4CLIENT -s $STATUS(pending, submitted, shelved)
 +</code>
 +
 +==== See the latest change in current directory local have ====
 +<code>
 +p4 changes -m1 ...#have
 +</code>
 +
 +====See the latest change in current directory server have ====
 +<code>
 +p4 changes -m1 ...
 +</code>
 +
 +====Check-in change ====
 +<code>
 +p4 submit -c changelist#
 +</code>
 +
 +====Shelve a change ====
 +<code>
 +p4 shelve -r -c changelist#
 +</code>
 +
 +==== Discard the shelved files ====
 +<code>
 +p4 shelve -d -c changelist#
 +</code>
 +
 +==== Unshelve a change ====
 +<code>
 +p4 unshelve -s shelvelist# [-c changelist#] [file]
 +</code>
 +
 +==== Displays full information about a single changelist ====
 +<code>
 +p4 describe changelist#
 +</code>
 +
 +==== Lists files currently opened in pending changelists ====
 +<code>
 +p4 opened
 +</code>
 ==== Add directory recursively to perforce depot ==== ==== Add directory recursively to perforce depot ====
 +
 <code bash> <code bash>
 # In Windows # In Windows
Line 17: Line 98:
 files -f -q -r -s | p4 -x - add files -f -q -r -s | p4 -x - add
 </code> </code>
 +
 ===== Git ===== ===== Git =====
 +=== GUI client ====
 +  * [[http://gitk.sourceforge.net/|gitk]] - graphical history browser, in Tcl/Tk, distributed with Git (usually in gitk package)
 +  * [[http://www.kernel.org/pub/software/scm/git/docs/git-gui.html|git gui]] - graphical commit tool, in Tcl/Tk, distributed with Git (usually in git-gui package)
 +  * [[http://digilander.libero.it/mcostalba/|QGit]] - uses Qt toolkit
 +  * [[https://wiki.gnome.org/Apps/giggle|Giggle]] - uses GTK+ toolkit
 +  * [[http://cola.tuxfamily.org/|git-cola]] - uses PyQt4
 +  * [[http://git.gnome.org/cgit/gitg/|gitg]] - GTK+/GNOME clone of GitX
 +  * [[http://jonas.nitro.dk/tig/|tig]] - text mode interface for git, is GUI and pager, uses ncurses
 +  * [[https://sites.google.com/site/gitforcetool/home|GitForce]] Git tool with Graphical user interface, available under GNU GPL license
 +==== Git clone specified branch ====
 +<code bash>
 +git clone {URL} -b master
 +</code>
  
 +==== Git switch branch ====
 +<code bash>
 +git checkout dev
 +</code>
 +
 +==== Git delete local branch ====
 +<code bash>
 +git branch -d test_branch
 +</code>
 +
 +==== Git delete remote branch ====
 +<code bash>
 +git push origin :test_branch
 +</code>
 +
 +==== Git push branch to remote ====
 +<code>
 +git push -u origin new_branch
 +</code>
 ===== SVN ===== ===== SVN =====
 +
  
dev/kb/version_control.1399212914.txt.gz · Last modified: 2020/06/06 23:32 (external edit)