9 PROBLEMS WITH REPLACING "MASTER" IN GIT

When working with Git in projects, sometimes you will need to lớn change the branch name you created in Git repository.

Bạn đang xem: 9 problems with replacing "master" in git

For example, I have sầu a repository on GitHub named questions-management & this repository has a branch named example as follows:

*

Now I will rename this branch to the new name, example_pixshare.vn!

To do this, I will first clone this remote repository khổng lồ local, then use some Git commands as follows:

– First, I will switch the current branch of this repository to lớn branch example using the “git checkout” command:


Java
git checkout -b example
1
git checkout -b example

– Now we will use the “git branch” commvà to rename the current branch to lớn the new name, example_pixshare.vn:


Java
git branch -m example_pixshare.vn
1
git branch -m example_pixshare.vn

– Next, we need lớn run the following comm& to delete this branch example on remote and push the branch with the new name from local lớn remote:


Java
git push origin :example example_pixshare.vn
1
git push origin :example example_pixshare.vn

– And the last thing we need lớn do is rephối upstream to local branch trachồng remote branch for branch example_pixshare.vn.


Java
git push origin -u example_pixshare.vn
1
git push origin -u example_pixshare.vn

*

Result:

*


Previous Post: Using Quartz Scheduler with Spring framework
Next Post: Using xpath3() in Mule 3

Add Comment Cancel reply


Name (required)
E-Mail (required)
Website (optional)

Submit Comment

Search Google


Announcement


Most Viewed


Recent Comments


Get Updates

Subscribe to our newsletter to receive breaking news by email.

Xem thêm: Hướng Dẫn Build Abyss Walker, Abyss Walker Build Skill Lvl 95 Pve


Theme: GoMedia by ThemeJunkie. Baông xã To Top
Insert/edit linkClose

Enter the destination URL


URL
Link Text
xuất hiện liên kết in a new tab

Or link khổng lồ existing content


Search
No search term specified. Showing recent items.Search or use up và down arrow keys to lớn select an nhà cửa.
Cancel