Giter Site home page Giter Site logo

git-scripts's Introduction

Bash scripts for frequently used Git commands

Git Clone

Setup

  1. Edit branch names (line 3, 4) don't edit variable names unless you change all occurances.
  2. Edit GitHub username (GitHub ssh must already be enabled on your machine)
  3. Run ./gitClone.sh and follow the prompt

Usage Examples

Clone from URL
./gitClone.sh
Q: Use full git URL?
(y/n): y
Enter the full git URL
<https://github.com/user/repo.git>
Select the branch to use
1) dev_branch
2) main_branch
3) custom
4) quit
Selected <selected branch> branch
Cloning into repo <https://github.com/user/repo.git>
Changing directory => <repo>
Creating branch <selected branch>
Finished cloning into repo <user/repo> and selecting branch <selected branch>
Installing dependencies...
Navigate to new repo by running cd ./<repo>
Clone from repo with non default GitHub username
./gitClone.sh
Q: Use full git URL?
(y/n): <n>
Use default GitHub username? (<default username>)
(y/n): <n>
Enter username: 
<username>
Using username: <custom username>
GitHub repo name: 
<repo>
Select branch to clone into.
1) dev_branch
2) main_branch
3) custom
4) quit
<branch number>
Selected <selected branch> branch
Cloning into repo <user/repo>
Changing directory => <repo>
Creating branch <selected branch>
Finished cloning into repo <user/repo> and selecting branch <selected branch>
Installing dependencies...
Navigate to new repo by running cd ./<repo>
Clone from repo name
./gitClone.sh
Q: Use full git URL?
(y/n): n
Use default GitHub username? (<default username>)
(y/n): y
Using username: <default username>
GitHub repo name: 
<repo>
Select branch to clone into.
1) dev_branch
2) main_branch
3) custom
4) quit
<branch number>
Selected <selected branch> branch
Cloning into repo <user/repo>
Changing directory => <repo>
Creating branch <selected branch>
Finished cloning into repo <user/repo> and selecting branch <selected branch>
Installing dependencies...
Navigate to new repo by running cd ./<repo>
Clone from repo name, with custom branch name
./gitClone.sh
Q: Use full git URL?
(y/n): n
Use default GitHub username? (<default username>)
(y/n): y
Using username: <default username>
GitHub repo name: 
<repo>
Select branch to clone into.
1) dev_branch
2) main_branch
3) custom
4) quit
<3>
Enter branch name:
<custom branch name>
Selected <selected branch> branch
Cloning into repo <user/repo>
Changing directory => <repo>
Creating branch <selected branch>
Finished cloning into repo <user/repo> and selecting branch <selected branch>
Installing dependencies...
Navigate to new repo by running cd ./<repo>

Git Push

Setup

  1. Run ./gitAdd.sh and follow the prompt

Usage Examples

Stage all files for commit
./gitAdd.sh
Stage files in git.
Which files would you like to stage?
1) all
2) allWithChanges
3) custom
4) quit
<1>
Adding all files in current directory to git via git add .
Commit description:
<commit description>
All files in current directory staged for commit.
Commit description: <commit description>
Stage all changed files for commit
./gitAdd.sh
Stage files in git.
Which files would you like to stage?
1) all
2) allWithChanges
3) custom
4) quit
<2>
Adding all changed files in current directory to git via git add -a
Commit description:
<commit description>
ll files with changes in current repository staged for commit.
Commit description: <commit description>
Stage custom files for commit
./gitAdd.sh
Stage files in git.
Which files would you like to stage?
1) all
2) allWithChanges
3) custom
4) quit
<3>
Which files/directories do you want to stage for commit? Ex: ./src ./utils/app.ts
<paths to file(s) or directory>
Commit description:
<commit description>
Files and/or directories staged for commit.
Commit description: <commit description>
Files/directroies selected: <paths to file(s) or directory>

git-scripts's People

Contributors

bracesproul avatar

Stargazers

vienues avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.