In this guide I will walk you how to use Github. You will see the requirements for using GitHub
Step 1: Install git
Windows
For Windows follow this Guide to Install Git on Windows
Mac OS
For Mac OS follow this Guide to Install Git on Mac OS
Step 2: Register a GitHub account
To be able to use GitHub you need to create an account you need to register an account. To do so go to github.com/join and fill out his form:
Step 3: Create a local git repository
Go in your terminal to the folder where you want to create a git repository. Create it by executing git init
.
You will get a confirmation that looks like this: Initialized empty Git repository in
$yourFolder
Step 4: Add a new file to the repo
To add a file to the repository execute git add $filename
Replace $filename with the name of the actual file you want to add to your repository
Step 5: Create a commit
To create a commit execute git commit -m $commitMessage
Replace $commitMessage with a message that explains what you did here
Step 6: Create a new branch
To create a new branch execute git checkout -b $branchName
Replace $branchName with the name you want to give the branch your working on.
Step 7: Create a new repository on GitHub
Click on Create repository
. The confirmation looks like this:
Step 8: Push a branch to GitHub
To push the content of a branch execute git push -u origin $branchName
Replace $branchName with you wished branch
Step 9: Create a Pull Request (PR)
Navigate your web browser to github.com/$project/pulls and click on New pull request
:
You will see a mask like this:
Select your target repository in base (the left one) and your source repository in compare (right one).
Click on Create pull request:
You will see this mask:
Click on “Create pull request” and you created the pull request.
Step 10: Merge a PR
To merge a PR you go to GitHub, the pull request you just created and scroll down until you see “Merge pull request”:
Step 11: Get changes on GitHub back to your computer
To get changes make sure you have checked out your branch by executing git checkout $branchName
Replace $branchName by the branch you want
Then execute git pull
Best,
Frank
Sources: