This README provides an overview of the code and explains how to use it. The code is a Python script that allows you to commit and push changes to a Git repository with a specified date and time.
Before using this script, ensure that you have the following:
- Python 3 installed on your system.
- Git installed and configured on your system.
To install the script, you can use the following command:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/MaximCosta/push_at/main/install.sh)"
The installation script will perform the following steps:
- Clone the repository containing the script.
- Install any necessary dependencies (optional).
- Make the script executable.
- Create a symbolic link to make the script accessible globally.
To use the script, follow these steps:
-
Open a terminal or command prompt.
-
Run the following command to commit and push changes with a specified date and time:
fpush [-a ADD] [-m MESSAGE] [-d DATE]
The script accepts the following optional arguments:
-a ADD, --add ADD
: Thegit add
option. Specifies the files to add to the commit. If not provided, the default is to add all files (.
).-m MESSAGE, --message MESSAGE
: The commit message. If not provided, the default is set to "Update".-d DATE, --date DATE
: The date and time for the commit. Use the formatYYYY-MM-DD HH:MM:SS
. If not provided, the default is the current date and time.
Note: Make sure to replace
fpush
with the appropriate command if you chose a different name during the installation. -
The script will execute the following steps:
- Adds the specified files or all files (
.
) to the Git staging area usinggit add
. - Sets the commit date and author date to the specified date or the current date and time.
- Commits the changes with the provided commit message using
git commit
. - Pushes the changes to the remote repository using
git push
.
Make sure you have the necessary permissions to perform the commit and push actions.
- Adds the specified files or all files (
Here are some examples of how to use the script:
-
Commit and push all files with the default commit message and the current date and time:
fpush
-
Commit and push all files with a custom commit message and the current date and time:
fpush -m "Fix bug"
-
Commit and push a specific file with a custom commit message and date:
fpush -a myfile.txt -m "Add myfile.txt" -d "2023-06-05 14:30:00"
Note: If you encounter any errors or have issues using the script, please refer to the error messages displayed or seek assistance.