-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from Aydinhamedi/Alpha-b
Alpha b
- Loading branch information
Showing
8 changed files
with
10,717 additions
and
6,221 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@echo off | ||
set /p branchName="Enter the branch name to archive: " | ||
|
||
:: Check if the branch exists locally | ||
git rev-parse --verify %branchName% >nul 2>&1 | ||
if errorlevel 1 ( | ||
echo The branch '%branchName%' does not exist locally. | ||
echo Fetching the branch from the remote repository... | ||
git fetch origin %branchName%:%branchName% | ||
) | ||
|
||
:: Check if the fetch was successful | ||
git rev-parse --verify %branchName% >nul 2>&1 | ||
if errorlevel 1 ( | ||
echo Failed to fetch the branch '%branchName%'. Please check the branch name and try again. | ||
exit /b | ||
) | ||
|
||
:: Archive the branch | ||
set tagName=archive/%branchName% | ||
git tag %tagName% %branchName% | ||
git push origin %tagName% | ||
echo Branch %branchName% has been archived as %tagName%. | ||
|
||
:: Ask the user if they want to delete the branch | ||
set /p deleteBranch="Do you want to delete the branch locally and remotely? (yes/no): " | ||
if /i "%deleteBranch%"=="yes" ( | ||
git branch -d %branchName% | ||
git push origin --delete %branchName% | ||
echo Branch %branchName% has been deleted. | ||
) | ||
|
||
:: Suggest a filename for the batch file | ||
set filename=archive_git_branch_%branchName%_%date:/=-%.bat | ||
echo Suggested filename for this batch file is: %filename% | ||
:: Filename: archive_git_branch.bat | ||
|
||
@echo off | ||
set /p branchName="Enter the branch name to archive: " | ||
|
||
:: Check if the branch exists locally | ||
git rev-parse --verify %branchName% >nul 2>&1 | ||
if errorlevel 1 ( | ||
echo The branch '%branchName%' does not exist locally. | ||
echo Fetching the branch from the remote repository... | ||
git fetch origin %branchName%:%branchName% | ||
) | ||
|
||
:: Check if the fetch was successful | ||
git rev-parse --verify %branchName% >nul 2>&1 | ||
if errorlevel 1 ( | ||
echo Failed to fetch the branch '%branchName%'. Please check the branch name and try again. | ||
exit /b | ||
) | ||
|
||
:: Archive the branch | ||
set tagName=archive/%branchName% | ||
git tag %tagName% %branchName% | ||
git push origin %tagName% | ||
echo Branch %branchName% has been archived as %tagName%. | ||
|
||
:: Ask the user if they want to delete the branch | ||
set /p deleteBranch="Do you want to delete the branch locally and remotely? (yes/no): " | ||
if /i "%deleteBranch%"=="yes" ( | ||
git branch -d %branchName% | ||
git push origin --delete %branchName% | ||
echo Branch %branchName% has been deleted. | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters