You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
[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.
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
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
Make the Desired Changes: Open the repository in your preferred IDE and make the necessary changes to the code, documentation, or any other files.
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
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"
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
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.
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.
The text was updated successfully, but these errors were encountered:
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?
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.
[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 thegit clone
command.git clone [email protected]:volkamerlab/volkamerlab_org.git
Pull new changes: Always update the repository on your local machine using the
git pull
command before making any changes while you're on themaster
branch. It will update the content, ifAlready up to date.
is produced, you can proceed to the next step.git checkout master
git pull
Create a New branch: Switch to a new branch for your changes using the
git checkout -b branch-name
command. Replacebranch-name
with a descriptive name for your branch.git checkout -b branch-name
Make the Desired Changes: Open the repository in your preferred IDE and make the necessary changes to the code, documentation, or any other files.
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
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"
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
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.
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:
git status
.git revert <commit hash>
and don't forget to push it to update the repository.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.
The text was updated successfully, but these errors were encountered: