Changes between Version 5 and Version 6 of cs222p-2018-fall-git


Ignore:
Timestamp:
Oct 3, 2018, 2:30:15 PM (7 years ago)
Author:
Qiushi Bai
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • cs222p-2018-fall-git

    v5 v6  
    101101shell> git branch            - This command is used to check which branch you are on and what branches are there in your repository. master should be highlighted as you are on master branch.
    102102shell> git checkout -b bob-feature1            - This command creates a new branch and copies all the code from the previous (i.e. master in our case) branch into the new branch.
     103---- Suppose you add a new source code file hello.cpp
    103104shell> echo '#include <iostream>' >> hello.cpp
    104105shell> echo 'using namespace std;' >> hello.cpp
    105106shell> echo 'int main() { cout << "Hello, World!"; return 0; }' >> hello.cpp
     107---- Suppose you make hello.cpp work, you will push it to the server
    106108shell> git add hello.cpp
    107109shell> git commit -m "added hello world"            - commits changes locally to the bob-feature1 branch