- Fork this workbook to your account by clicking the "Fork" button
- On your forked repository, click the "Clone or download" button and copy the url
- On your computer create a folder that will contain your repository
- Open Git Bash and navigate to the folder created above
- Use git clone command to download the repository into your computer, replace
"url"
with the url from step 2.
git clone "url"
- Navigate into the directory and leave the Git Bash open, we will use it later
cd git-workbook
- Open Visual Studio Community
- On the top menu select
File -> New -> Project
or use the keyboard shortcutControl + Shift + N
- From the left menu select
Visual C# -> Windows Classic Desktop
then on the right selectConsole App (.NET Framework)
. Set the project name asCSharpProject
, the location can be anywhere in your computer, just make sure it is outside your recent cloned repository folder - Visual Studio will create a initial
Program.cs
file. You can delete it, we wont need it - To add a file to the project, right-click on top of CSharpProject
Add -> Existing Item...
or use the keyboard shortcutShift + Alt + A
- Navigate to the
/git-workbook/01Week/
repository/folder and select the fileHelloWorld.cs
- The Add button has a small arrow pointing down. Click on that and select
Add As Link
. If you just add it, it will copy the file and you won't be able to track it in your repository. - Open the file you just added as a link
- Change th text inside
Console.WriteLine
method to"Hello Word"
and save it
- Get back on Git Bash and check the status of your repository - You should see the file HelloWorld.cs appear in red
git status
- Stage the file using:
git add -A
- Commit that staged file
git commit -m "Hello World"
- Push your changes up to your remote repository
git push
- Head to your remote repository in GitHub
- Click on
new pull request
button and name it using your name
If you are having some trouble with the steps watch this video here