Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:41:44+00:00 2026-06-01T23:41:44+00:00

I need to do several two-step or three-step commands in Git quite frequently, that

  • 0

I need to do several “two-step” or “three-step” commands in Git quite frequently, that require me to also specify a branch name as a parameter – things like:

git checkout (branch name)
git pull origin (branch name)

or stuff like that. I would like to “automate” this into an alias – but a simple Git alias won’t do – right?

So how can I do this in a Bash shell script? I am well versed in MS-DOS/Windows batch scripts – but I am a total newbie to Bash.

All the examples of Bash alias with more than one Git command I’ve seen so far seem to not have any parameters…… but I am jumping back and forth between various branches, so I definitely need to define which branch to check out and update from the central repo…

Any help? Any blog posts or articles that a *nix newbie would understand? Any pointers are highly welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:41:46+00:00Added an answer on June 1, 2026 at 11:41 pm

    You can define an alias like this:

    [alias]
      chepull = !git checkout $1 && git pull origin
    

    You can do:

    git chepull branch_name 
    

    Note: $1 is intentionally not specified in git pull origin, but should work as intended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to run a function that takes two arguments several times. I have
I need to adjust several views in the event that a user visits my
I have an object in a list that I need to rank several different
I need a way to store several images in one/two (some projects seems to
I need to pull several rows from a table and process them in two
I need to send several commands over telnet to a server. If I try
I need to create a blackberry application that connects two phones for information exchange.
While writing several math utilities I bumped into need to implement generic utility that
I have several (old) Drupal-sites that need to be replaced with one single new
So in this particular MVVM implementation I'm doing, I need several commands. I really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.