Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any Git shortcuts for the current branch and the branch it tracks?

I would like to do something like this:

$ git fetch origin
$ git rebase -i origin/a_very_very_very_long_branch_name

Where, my local branch name is as same as a_very_very_very_long_branch_name.

So when I execute this kind of command, I don't want to copy and paste the long branch name again and again.

Are there any shortcuts for the current branch name in Git?

like image 743
Ya Zhuang Avatar asked May 04 '13 05:05

Ya Zhuang


1 Answers

In your particular example, if your branch is tracking the remote branch, you can just do

git fetch
git rebase -i

Without parameters.

In case your branch is not tracking the remote branch, that can be set up by doing

git branch -u origin/a_very_very_very_long_branch_name
like image 162
Klas Mellbourn Avatar answered Nov 15 '22 07:11

Klas Mellbourn