Skip to content

Latest commit

 

History

History
133 lines (46 loc) · 2.91 KB

File metadata and controls

133 lines (46 loc) · 2.91 KB

Project 2

For the second activity you will contribute to a project. Here is the link to the repository, https://github.com/HamoyeHQ/Version-ctrl-with-git.git

1.Fork the repository. 2.Clone the repository, so you can have a copy of the repository on your local machine. 3.Create a new branch 4.Contribute 5.Stage changes 6.Commit changes 7.Create a pull request (PR)

#Solution

  1. To "fork" the repository, go to the repository, click on "fork" and select which account to copy the repository to.

  2. Copy the link to your version of the repository.

  3. To clone the repository, go to the folder where you want the repository to be copied to and "git bash" here. Then run the command to clone a repository.

git clone url

  1. Close the "git bash", open the cloned repository and do "git bash" here.

  2. Create a branch. You can name the branch anything, but it’s preferable to use your name. You can do this by running the command;

git branch branchname

image

  1. Switch to the new branch using the git checkout command;

Git checkout branch name

image

  1. Edit the attendance.txt file using any text editor. Add your name to the list of names. Save and exit.

  2. “git add” to stage the changes

“git add. “

  1. “Git commit” to commit the changes,

image

  1. Switch to the master branch

git checkout master.

  1. Pull changes so that your copy can be up to date with the remote repository.

Git pull origin master

image

  1. Push your branch to the remote repository.

First switch back to your new branch

Then push

Git push -u origin branch name

image

Yes, we just pushed to the remote repository, but we need to create a PR to notify the owner of the repository that we want to make changes,

  1. Make a Pull request (PR).

If you check the message after the push command, you will get the link to create the pull. For example,

https://github.com/zalihat/Version-ctrl-with-git/pull/new/attendance

  1. Follow the link to create a PR

The link will look like this;

image

Create the Pull request and wait for the reviewer to merge your pull request.

You will get a notification once your pull request has been merged.

Congratulations, you have successfully contributed to another person’s repo. This is how you contribute to open source projects.