Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add content or make changes to the repository #126

Open
hamzaibrahim21 opened this issue May 31, 2023 · 1 comment
Open

How to add content or make changes to the repository #126

hamzaibrahim21 opened this issue May 31, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@hamzaibrahim21
Copy link
Collaborator

hamzaibrahim21 commented May 31, 2023

Description:

I noticed that sometimes it gets confusing to make changes to the repository. In this issue, I provide a step-by-step guidance to make changes to current or any repository flawlessly. You can also have a look here.

  1. [only first time] Clone the Repository: In case the repo has not been downloaded yet, clone the master branch of the repository to your local machine using the git clone command.

  2. Pull new changes: Always update the repository on your local machine using the git pull command before making any changes while you're on the master branch. It will update the content, if Already up to date. is produced, you can proceed to the next step.

    • git checkout master
    • git pull
  3. Create a New branch: Switch to a new branch for your changes using the git checkout -b branch-name command. Replace branch-name with a descriptive name for your branch.

    • git checkout -b branch-name
  4. Make the Desired Changes: Open the repository in your preferred IDE and make the necessary changes to the code, documentation, or any other files.

  5. Add Changes : Add the changes to your branch on GitHub using the git add changed-file-name command. This command stages changed files to the next commit.

    • git add changed-file-name
  6. Commit Changes : Commit the changes to your branch on GitHub using the git commit -m "add-commit-message-here" command. This step takes a snapshot of the changes to be recorded in the repository's history.

    • git commit -m "add-commit-message-here"
  7. Push Changes to GitHub: Push the changes to your branch on GitHub using the git push origin branch-name command. This will update your remote repository with the latest changes.

    • git push origin branch-name
  8. Create a Pull Request (PR): Go to the original repository and click on the "New Pull Request" button. Provide a descriptive title and description for your pull request. Click on "Create Pull Request" to submit it.

  9. Discuss and Review: Engage in discussions through the pull request with the repository maintainers. You may be asked to provide further details or feedback.

General notes:

Here are some additional notes, that might help you while working with Git or Github:

  • You can check which branch you're currently in and have a view of changed files, documents or any other files using git status.
  • It's always recommended to have a PR per change to keep tracking of changes easily, so if you'll make several changes, you're going to iterate over these steps for every change.
  • After submitting a PR, make sure there is no conflicts in the PR.
  • If you want to undo or revert a specific commit, you can use git revert <commit hash> and don't forget to push it to update the repository.
  • With git log you can check commits history and commit hashes.

These steps and general notes should help you make changes and track your work on Git, If you have any further questions or encounter any issues, please don't hesitate to contact us.

@AndreaVolkamer AndreaVolkamer added the documentation Improvements or additions to documentation label May 31, 2023
@AndreaVolkamer AndreaVolkamer changed the title How to make changes to the repository - 101 How to add content or make changes to the repository May 31, 2023
@PaulaKramer
Copy link
Contributor

Hi @hamzaibrahim21, thanks for writing the tutorial! Maybe we can move this post to the Wiki instead of leaving it here as an issue? Then it’s easier for everybody to find.
And on a separate note, I realized that in the main readme, it states that we should create a fork, create a branch and then a pull request from the fork to the main repository. Maybe we can change the readme or alternatively this tutorial - depending which way we want to recommend for the future. What do you think @AndreaVolkamer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants