![]() By following the steps outlined in this article, you’ll be well-equipped to manage your codebase effectively using Git branches. It allows you to work on multiple features or fixes simultaneously, without affecting the main branch. git push -u origin feature-branch:new-branch-name ConclusionĬreating local and remote Git branches is an essential skill for developers working with version control. You can also push the branch with another name to remote. This command pushes your local branch (“feature-login”) to the remote repository and sets up a tracking relationship between the local and remote branches. Use the following command: git push -u origin feature-branch Now, you’re ready to push your local branch to the remote repository. If you’re using GitHub, GitLab, or Bitbucket, create a new repository on their platform. If GitKraken Client has not automatically fetched changes, simply click the Pull button in the top toolbar and select the Fetch option from the dropdown menu. To do this, first, make sure you have a remote repository set up. ![]() In order to share your local branch with others or to work on it from another computer, you need to push it to a remote repository. Push the Local Branch to the Remote Repository In case, the local branch doesn’t yet exist, you can easily create it: git checkout -b feature-login 2. This command creates a new branch and switches to it immediately. ![]() Replace feature-login with a descriptive name for your new branch. Delete remote branch (pu) from github: git push github :pu. For example, create new remote branch (beta) on github from local branch (test): git push github test:beta. To do this, use the following command: git checkout feature-branch Creating a new branch on a remote uses the same syntax as updating a remote branch. Switch to the local repository branch you want to publish to remote. This article will help you to create a branch on local repository and then push branch to the remote Git repository. But, in case you don’t have web interface access, You can also do the same by creating a branch in local repository and push changes to remote. Most of the Git providers (like:, etc) provides option to create branch directly with web interface.
0 Comments
Leave a Reply. |