![]() ![]() You can simply run a plain git push or git pull without any further options! The tracking relationship saved the source/target branch and the exact remote so that it can be looked up in further interactions. To push the current branch and set the remote as upstream, use git push -set-upstream origin git-branch-demo hpLAPTOP-3NKORD70 MINGW64 /SampleProject. But here's a brief explanation: such a tracking relationship makes any future "push" and "pull" operations very easy. The article " How to Set Upstream Branch in Git" explains this in detail. Please mind the "-u" option: it establishes a "tracking relationship" between the existing local and the new remote branch. In the left branch tree panel, find the remote branch, right click and select the menu Fetch & Checkout if want to use the same name. Now, with the correct local branch checked out, you can publish it on a remote repository - thereby "creating" it on that remote: $ git push -u origin (2) Push the Local Branch to the Remote Repository Click the Push button to push your new branch to the repository. From Sourcetree's History, you'll see that the file has been updated on your new branch. In the message box, enter a commit message. Click the Commit button at the top to commit the file. ![]() Name this remote teamone, which will be your shortname for that whole URL. If such a local branch doesn't yet exist, you can easily create it: # To create a new local branch. Selecting Stage file from the options menu of the files. You can add it as a new remote reference to the project you’re currently working on by running the git remote add command as we covered in Git Basics. If you already have such a local branch at hand, you can simply check it out: $ git checkout ![]() As already said, creating a remote branch actually starts on the opposite end: in your local Git repository! You need to make sure you have a local branch that represents a state you want to push to the remote. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |