Contents
This is a simple introduction to the Git & GitHub workflow.
-
To get started, create a fork of this repository and cd into it.
gh repo fork "https://github.com/SDI1/starter-project" cd starter-project/
-
Build and run "hello.cpp"
g++ hello.cpp -o hello ./hello
You should see output like this:
-
You are now going to edit the program to print your name. Create a new branch.
git checkout -b "add-name"
-
Open "hello.cpp" with your favourite text editor or IDE and add the following line.
cout << "Hello, <insert your name here>!\n";
-
Build and run again.
g++ hello.cpp -o hello ./hello
This time the program should also display your name.
-
Now commit your changes.
git add . git commit -m "Add name"
-
Push your changes to the branch.
git push -u origin "add-name"
-
Open a pull request.
gh pr create