Skip to content

ADDED PPR CUSTOME COMMAND #13

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions commands/ppr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Project Name

This project includes custom scripts that automate frequently used Git commands. Below, you will find information about the `ppr` command which simplifies the Git workflow.

## ppr

### Description
The `ppr` command automates the process of pushing changes, pulling the latest updates, and rebasing your branch with the remote `main` branch. It combines three commonly used Git commands into one, streamlining your workflow:

```bash
git push origin main
git pull origin main
git rebase origin/main

```
instead of all above just run following
```
./ppr.sh

```
29 changes: 29 additions & 0 deletions commands/ppr/ppr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash


echo "Pushing changes to origin/main..."
git push origin main


if [ $? -eq 0 ]; then
echo "Changes successfully pushed to 'main' branch."
else
echo "Error: Failed to push changes."
exit 1
fi


echo "Pulling latest changes from origin/main..."
git pull origin main


echo "Rebasing with origin/main..."
git rebase origin/main

if [ $? -eq 0 ]; then
echo "Push, pull, and rebase process completed successfully!"
else
echo "Error: Rebasing failed."
exit 1
fi