GitHub forks and pull requests
Date 02/09/2014
Git client should be configured with your GitHub account information, so that the commits are registered to your user account at GitHub, instead of the current computer. Example commands below, please substitute with your proper values:
In case you wish to make the above configuration changes to a given repository, omit the --global
parameter.
Tasks that are done during this lecture:
Create local repository,
git init
Add files to it,
git add
Commit those files with a meaningful message,
git commit -m
Create an empty repository at GitHub
Add that as a remote for the repository made in task 1.
Push your local repository to GitHub, making it public,
git push
Create new repository at GitHub, with predefined files
Clone the repository,
git clone
Make changes and push them
Tag the latest commit of the repository made in 3. with Semantic Versioning number,
git tag
Add release notes to it in GitHub, thus making it a release
Create a fork from a repository of the student sitting next to you, that was created in 3.
Make few changes to the
README.md
and pushCreate a Pull Request
Make changes to your own repository, which the other has forked
Update the fork created in 5.,
git fetch
,git merge
Now that you are familiar with Git, GitHub and forking, feel free to fork this repository and create a pull request that would add your presentation subject and date #11.
Links related to the lecture subject
Examples for the tasks
1. Local repository with a file and a commit
2. Create empty repository at GitHub and push to it
After creating the empty repository via GitHub web page, add it as a remote and push to it.
Please note that the -u
parameter is a short version of --set-upstream
which is seen in the documentation. It needs to be used only at the first time pushing, after setting the remote repository URL.
3. Repository with predefined files
After creating the repository via GitHub web page, and selecting a predefined Node
specific .gitignore
file, license and default README
, clone it to your computer.
4. Tagging
Now in the release page at GitHub repository, the release needs to be created.
5. Forking
The rest of the task needs to be done in the GitHub page of the fork repository, where exists buttons for compare
and pull request
.
7. Updating fork
Assuming that the current working directory is the fork and it has master
checked out:
Last updated
Was this helpful?