GIT getting 2 branches from another machine onto mine

Viewed 33

I'm new to git so I'm setting up a git workflow to get the hang of it and I'm not sure how to get a branch on another machine onto mine, I've got 2 branches on my desktop:

master
release-0.1

The remote has these 2 branches too:

master
release-0.1

Then there's my laptop which has an old copy of master that needs to be deleted, and 2 other branches not on either remote or my desktop:

master (deleting)
new-feature-a
new-feature-b

I'm new to git so I'm not really sure what I should do, I want to work on new-feature-a on my desktop now and only work on new-feature-b on the laptop. Should I push new-feature-a to origin/new-feature-a then pull it to the desktop? Then once the feature is complete push it to the release-0.1 branch then merge it into master?

  • Should I keep a copy of master locally?
1 Answers

Here's what I would do

On the laptop

  • Commit all changes to new-feature-a
  • Push to remote

On Desktop

  • Pull new-feature-a
  • make changes and commit
  • Check out release-0.1
  • Merge with new-feature-a
  • Push release-0.1

  • Pull master

  • Merge with release-0.1
  • PUsh master

Yes, you will need the local copy of master if you wan to merge it with the new features.

Related