Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bin bash

Aperta
#11,065 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
bash, git
Ambito
cli, tooling

Direzione di ricerca

Il corpo dell’issue contiene uno script Bash inline per creare e fare push di un branch di funzionalità Git, ma non indica alcun file del repository, entry point o modifica prevista. Occorre prima chiarire dove deve trovarsi lo script e quale comportamento è richiesto; non vengono forniti criteri di completamento, quindi dall’issue da sola non è possibile identificare alcuna implementazione o alcun test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

User Story:
As a
I want to
So that

Acceptance Criteria
GIVEN
WHEN
THEN

Product & Design Links:

Tech Details:

Open Questions:

Notes/Assumptions:
#!/bin/bash

Purpose: Create a new feature branch and push it to the remote repository

Print messages with a timestamp

print_message() {
echo ""
echo "$(date +"%Y-%m-%d %H:%M:%S") - $1"
}

Display help message

show_help() {
echo "Usage: $0 <feature_branch_name>"
echo ""
echo "Options:"
echo " -h, --help Display this help message."
exit 0
}

Handle errors

handle_error() {
print_message "Error: $1"
exit 1
}

Parse command-line arguments

while [[ "$#" -gt 0 ]]; do
case $1 in
-h|--help) show_help ;;
*) FEATURE_BRANCH_NAME=$1; shift ;;
esac
done

Ensure a branch name is provided

if [[ -z "$FEATURE_BRANCH_NAME" ]]; then
handle_error "No feature branch name provided. Usage: $0 <feature_branch_name>"
fi

Check if git is installed

if ! command -v git &> /dev/null; then
handle_error "Git is not installed. Please install Git."
fi

Ensure inside a git repository

if ! git rev-parse --is-inside-work-tree &> /dev/null; then
handle_error "Not inside a valid git repository."
fi

Check if the branch exists locally

if git show-ref --verify --quiet refs/heads/"$FEATURE_BRANCH_NAME"; then
handle_error "Branch '$FEATURE_BRANCH_NAME' already exists locally."
fi

Clear local cache of remote branches

print_message "Fetching latest remote branches to clear any cached data."
git fetch origin --prune || handle_error "Failed to fetch remote branches."

Check if the branch exists remotely

if git ls-remote --heads origin "$FEATURE_BRANCH_NAME" | grep "$FEATURE_BRANCH_NAME" &> /dev/null; then
handle_error "Branch '$FEATURE_BRANCH_NAME' already exists on the remote."
fi

Create the new feature branch

print_message "Creating new feature branch: $FEATURE_BRANCH_NAME"
git checkout -b "$FEATURE_BRANCH_NAME" || handle_error "Failed to create feature branch: $FEATURE_BRANCH_NAME"

Push the new branch to the remote and set upstream tracking

print_message "Pushing feature branch '$FEATURE_BRANCH_NAME' to the remote repository"
git push -u origin "$FEATURE_BRANCH_NAME" || handle_error "Failed to push feature branch to the remote."

Show the current branch and status

print_message "Branch '$FEATURE_BRANCH_NAME' created and pushed successfully."
print_message "Current branch: $(git branch --show-current)"
git status || handle_error "Failed to show git status."

print_message "Script completed successfully."IMG_20241007_194517_519.jpg

Lingua principale
JavaScript
Stelle
1.8k
Fork
776
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gitcoinco/web

Tutte le issue di gitcoinco/web

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.