When you are working on a large scale application code base, it is very likely that you will get too many remote branches with similar names.
![Git Version Git-Branch is Ahead of origin/master By n Commits](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtAL7JIJx6G7VUN0Uhxd544vZqvCDKmnJsd-B3xRPTwbpo-2jSCH9SwjIoXIUQPf8bdFRxh6D6rNUe6T6a89LT8pQ_FzxnK1skRUrJzRaHrhlDIIkWfAglJPOvVYTcvEa8IziPSRmVdmQ/s400/Git-Logo-1788C.png)
You can easily narrow down the search by piping grep with the below command_
git
grep
{regexp}
To search branches that includes WTH_Bug, use the below command_
git
branch -r
|
grep
WTH_Bug
It will give you fewer options (with WTH_Bug) to pick from.
origin/WTH_Bug_WhoCares
origin/WTH_Bug_Experiment
origin/WTH_Bug_WTH
Now fetch the branch that you want to track.
git
fetch origin
WTH_Bug_Experiment
No comments:
Post a Comment