TL DR: git branch -set-upstream-to origin/solaris The branch clearly exists, so it was created and pushed: $ git branch -a Or, its another instance of Git taking a simple task and making it difficult. I'm guessing its another instance of a incomplete or wrong accepted answer. I followed this question and answer on Stack Overflow: Push a new local branch to a remote Git repository and track it too. Is there any reasonable use case where someone would create, push the to remote, and then claim a commit on is not supposed to be for ? Why do I have to do something special for this? To push the current branch and set the remote as upstream, use Add workaround for missing _mm_set_epi64xįatal: The current branch solaris has no upstream branch. After committing a change and attempting to push the changes: $ git commit blake2.cpp -m "Add workaround for missing _mm_set_epi64x" Tekin Limited is registered in England and Wales with Company numberĠ8423819 and VAT number GB 157904388.I created a local branch for testing Solaris and Sun Studio. Zero spam, and you can unsubscribe whenever you like with a single click.Įmail GitHub GitHub icon An icon of the GitHub logomark Mastodon Mastodon icon An icon of the Mastodon logomark Twitter Twitter icon An icon of the Twitter logomark You'll get an email whenever I have a fresh insight or tip to share. ![]() If you’re looking to power up your Git skills and understanding, sign up to my mailing list below! Want more juicy Git tips like this straight to your inbox? I’ve got a bunch more Git-related tips in the pipeline. Maybe because it feels more deliberate? Or perhaps it’s just part of my muscle memory… I personally still prefer to use the git upstream alias. Remote: Resolving deltas: 100% (2/2), completed with 2 local objects.īranch 'feature-x' set up to track remote branch 'feature-x' from 'origin'.Īlternatively, do it with a config settingĪs of Git version 2.37.0, it’s now possible to set a config setting that will make git push automatically push to the remote and set the tracking branch: git config -global -add -bool toSetupRemote true Our new alias essentially does the same thing, but instead of giving a specificīranch name we use HEAD, which is a reference to the tip of the currentīranch and means the command will work without having to explicitly use the name ![]() Remote origin with the same branch name and set that as the upstream branch to Helpfully, Git has told us the command we probably want to run to push to the Git is telling us that it doesn’t know where this branch should be pushed toīecause (at least by default) it doesn’t make assumptions about where a givenīranch should be pushed to or pulled from. This alias will be useful if you’ve ever tried to push up a new feature branchįatal: The current branch feature-x has no upstream branch. set the local branch to track the remote branch so that future git pushĪnd git pulls will automatically happen against the remote.To make your life a little easier if you work with feature branches: $ git config -global alias.upstream '!git push -u origin HEAD' Git tip: create a Git upstream alias January 10, 2020 Git tip: create a Git upstream alias | .uk .uk
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |