Changes between Version 5 and Version 6 of cs222p-2018-fall-git
- Timestamp:
- Oct 3, 2018, 2:30:15 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
cs222p-2018-fall-git
v5 v6 101 101 shell> 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. 102 102 shell> 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 103 104 shell> echo '#include <iostream>' >> hello.cpp 104 105 shell> echo 'using namespace std;' >> hello.cpp 105 106 shell> echo 'int main() { cout << "Hello, World!"; return 0; }' >> hello.cpp 107 ---- Suppose you make hello.cpp work, you will push it to the server 106 108 shell> git add hello.cpp 107 109 shell> git commit -m "added hello world" - commits changes locally to the bob-feature1 branch