diff --git a/.gitignore b/.gitignore index 837c1603..1dffe4c3 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,60 @@ .idea/ -.vscode/ \ No newline at end of file +.vscode/ + +# Created by https://www.toptal.com/developers/gitignore/api/emacs +# Edit at https://www.toptal.com/developers/gitignore?templates=emacs + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +# End of https://www.toptal.com/developers/gitignore/api/emacs diff --git a/gitflow.sh b/gitflow.sh new file mode 100755 index 00000000..d6e090a1 --- /dev/null +++ b/gitflow.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Prompt for GitHub username +read -p "Enter your GitHub username: " GITHUB_USER + +# Clone the forked repository +echo "Cloning forked repository..." +git clone git@github.com:$GITHUB_USER/getnighthawk.git +cd getnighthawk || { echo "Failed to enter repo directory"; exit 1; } + +# Add upstream remote +echo "Adding upstream remote..." +git remote add upstream https://github.com/layer5io/getnighthawk.git + +# Verify remotes +echo "Verifying remotes..." +git remote -v + +# Fetch upstream +echo "Fetching upstream..." +git fetch upstream + +# Show branches +echo "Listing branches..." +git branch -va + +# Checkout master and merge upstream +echo "Updating local master branch..." +git checkout master +git merge upstream/master + +# Prompt for branch type and name +echo "Creating a new branch for your work..." +read -p "Enter branch type (feature/bug): " BRANCH_TYPE +read -p "Enter issue number or short name: " BRANCH_NAME + +NEW_BRANCH="$BRANCH_TYPE/$GITHUB_USER/$BRANCH_NAME" + +git checkout master +git branch "$NEW_BRANCH" +git checkout "$NEW_BRANCH" + +echo "You are now on branch: $NEW_BRANCH" +echo "Make your changes, commit, and push when ready." + +# Instructions for rebasing before PR +echo "When ready to submit a PR, run:" +echo " git fetch upstream" +echo " git checkout master" +echo " git merge upstream/master" +echo " git checkout $NEW_BRANCH" +echo " git rebase master" +echo "Optionally squash commits with: git rebase -i master"