How can I check with a git branch on a fork of my origin?

GitHub has a /abc repository that I forked. So my plug is in me/abc .

Jim also forced /abc , with their repo at Jim/abc . Jim added a branch named 2.0 . This branch does not exist on /abc .

I already cloned the fork from me/abc locally (used GitHub for the window). Now I would like to make some changes to the 2.0 branch of Jim/abc locally, and they commit and return the changes.

What is the best way to do this?

+4
source share
1 answer

I was able to accomplish this by following these steps:

1. Add Remote reference to Jim/abc :

 git remote add jim https://github.com/jim/abc.git 

2. Extract the Jim repository:

 git fetch jim 

3. Checkout the branch with the Jim/abc remote control:

 git checkout jim/2.0 

The branch is now in the "disconnected HEAD" state.

4. Create a local branch:

 git checkout -b 2.0 

The branch is now verified and ready to work locally.

+5
source

Source: https://habr.com/ru/post/1487026/


All Articles