Creating A Branch In Remote Git Repository - TecAdmin
Maybe your like
Git Tips: How to Create a Remote BranchBy RahulApril 26, 20252 Mins Read Branching makes efficient ways to manage versioning of your application code. The popular version management tools supported branches like Git, SVN etc. Development in branching make process easier by splitting code in branches per modules.
Most of the Git providers (like: github.com, gitlab.com etc) provides option to create branch directly with web interface. 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.
This article will help you to create a branch on local repository and then push branch to the remote Git repository.
1. Local Branch You Want to Publish
Switch to the local repository branch you want to publish to remote. To do this, use the following command:
git checkout feature-branchReplace feature-login with a descriptive name for your new branch. This command creates a new branch and switches to it immediately.
In case, the local branch doesn’t yet exist, you can easily create it:
git checkout -b feature-login2. Push the Local Branch to the Remote Repository
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. To do this, first, make sure you have a remote repository set up. If you’re using GitHub, GitLab, or Bitbucket, create a new repository on their platform.
Now, you’re ready to push your local branch to the remote repository. Use the following command:
git push -u origin feature-branchThis command pushes your local branch (“feature-login”) to the remote repository and sets up a tracking relationship between the local and remote branches.
You can also push the branch with another name to remote.
git push -u origin feature-branch:new-branch-nameConclusion
Creating local and remote Git branches is an essential skill for developers working with version control. It allows you to work on multiple features or fixes simultaneously, without affecting the main branch. By following the steps outlined in this article, you’ll be well-equipped to manage your codebase effectively using Git branches.
branch git Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsAppRelated Posts

How to Work Better with Git in Teams
Your push was rejected because it contains files larger than 10 MiB

How to Delete the Last Pushed Commit
Add A Comment Leave A Reply Cancel Reply AdvertisementRecent Posts
- How to Install Python 3.14 on Ubuntu 24.04 & 22.04
- Using loops in Terraform
- How to Rotate Laravel Log Files
- How to Install PHP (8.4,7.4 & 5.6) on Debian 13
- How to Setup ERPNext v15 on Ubuntu 24.04 & 22.04
Tag » Add Branch Git Remote
-
Git Add Remote Branch - Stack Overflow
-
Remote Branches - Git
-
Git-remote Documentation - Git
-
How To Create A Remote Branch In Git | Learn Version Control With Git
-
How To Push Git Branch To Remote - Devconnected
-
How To Push New Git Branches To Remote Repos On GitHub Or GitLab ...
-
How To Create A Remote Branch In Git - W3docs
-
Git Checkout | Atlassian Git Tutorial
-
How To Add A New Remote To Your Git Repo - Assembla Help Center
-
Push A New Local Branch To A Remote Git Repository And Track It Too
-
How To Fetch A Remote Branch Using Git | LoginRadius Blog
-
Easily Perform Git Checkout Remote Branch [Step-by-Step]
-
Git Branches: List, Create, Switch To, Merge, Push, & Delete
-
Create And Push A Branch To A Remote Git Repository - Techie Delight