Changes between Version 4 and Version 5 of cs222p-2018-fall-git
- Timestamp:
- Oct 3, 2018, 2:28:03 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
cs222p-2018-fall-git
v4 v5 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 shell> mkdir project1104 shell> cd project1105 shell> echo "#include <iostream> using namespace std; int main() { cout << "Hello, World!"; return 0; }" > hello.cpp103 shell> echo '#include <iostream>' >> hello.cpp 104 shell> echo 'using namespace std;' >> hello.cpp 105 shell> echo 'int main() { cout << "Hello, World!"; return 0; }' >> hello.cpp 106 106 shell> git add hello.cpp 107 107 shell> git commit -m "added hello world" - commits changes locally to the bob-feature1 branch