GIT getting 2 branches from another machine onto mine

Multi tool use
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?
git
add a comment |
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?
git
"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07
add a comment |
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?
git
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?
git
git
asked Dec 28 '18 at 3:03
coder
346
346
"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07
add a comment |
"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07
"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07
"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953216%2fgit-getting-2-branches-from-another-machine-onto-mine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered Dec 28 '18 at 3:28
Zhao Hainan
38226
38226
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953216%2fgit-getting-2-branches-from-another-machine-onto-mine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
48yfl3,sIP,FV5iDGtB3fFayqpo7cnkQADxrWqtfo3tzK,Lr2 YTCe,7b9rHIKxc,vvuKRYK
"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07