Changes between Version 1 and Version 2 of Basic Git Usage


Ignore:
Timestamp:
Jun 14, 2009, 4:04:52 PM (15 years ago)
Author:
Joe Ciccone
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Basic Git Usage

    v1 v2  
    8989git reset --hard
    9090}}}
     91
     92=== Creating a new branch from the current ref ===
     93
     94Using git checkout you can start a new branch:
     95
     96{{{
     97git checkout -b testing
     98}}}
     99
     100Lets change the test file in this branch so we can identify it in the future:
     101
     102{{{
     103echo "Testing Branch" > testfile
     104git add testfile
     105git commit -m "Change the test file for the Testing Branch"
     106}}}
     107
     108=== Switching between branches ===
     109
     110Using git checkout you can switch between branches. Switch back to master and check the testfile:
     111
     112{{{
     113git checkout master
     114cat testfile
     115}}}
     116
     117Switch back to testing and check the test file
     118
     119{{{
     120git checkout testing
     121cat testfile
     122}}}