git-branch

What are those red remote branches on Git?

怎甘沉沦 提交于 2020-06-11 16:34:46
问题 I'm new to git and trying to set up a repository. I got two branches ( master and xyz ). My workflow so far: change to specific branch, e.g. git checkout xyz make changes git add . git commit -am 'whatevermessage' git push origin xyz Everything works so far. But when I git branch -a to view all my branches, I get the following output: master * xyz remotes/origin/master remotes/origin/xyz while remotes/origin/master and remotes/origin/xyz are displayed in red color. I tried to figure out what

Git- some how a single branch having two names created how do i make it single

烂漫一生 提交于 2020-05-16 22:01:35
问题 I just tried to rename the branch with following command git branch -m <oldname> <newname> my older branch name is feature/AAM-443 and this branch is already merged with parent now when i renamed it with feature/AAMN-443 and push it to remote then the branch in network is showing *<commit id> feature/AAM-443, feature/AAMN-443 and if i do some commit to feature/AAMN-443 then graph is like * <new-commit id> feature/AAMN-443 | | * <old-commit id> feature/AAM-443 what is happening i am wondering

Git- some how a single branch having two names created how do i make it single

妖精的绣舞 提交于 2020-05-16 22:01:02
问题 I just tried to rename the branch with following command git branch -m <oldname> <newname> my older branch name is feature/AAM-443 and this branch is already merged with parent now when i renamed it with feature/AAMN-443 and push it to remote then the branch in network is showing *<commit id> feature/AAM-443, feature/AAMN-443 and if i do some commit to feature/AAMN-443 then graph is like * <new-commit id> feature/AAMN-443 | | * <old-commit id> feature/AAM-443 what is happening i am wondering

Git reset and/or delete commit on remote branch

霸气de小男生 提交于 2020-04-18 06:12:50
问题 I have a small issue regarding git. At the beginning of the project i have clean flow (figure 1 and 2). Figure 1 is from Intellij, while figure 2 is after running gitk & command. As expected we see same states. But after merging "branch3" with "master", we realize that it is not good and want to delete that commit. We execute following command: git reset --hard HEAD~1 . As expected, after executing this command we are at following state: And from that state we create new branch "branch4".

fatal: your current branch appears to be broken

懵懂的女人 提交于 2020-04-14 12:14:11
问题 I give this error when I use git log fatal: your current branch appears to be broken my branch file was broked I opened .git/refs/heads/mybranch in notepad but I see only some ????????? in file I know I must find branch hash and copy that into .git/refs/heads/mybranch file but I don't how to find that hash I read this topic Broken branch in git, fatal: your current branch appears to be broken 回答1: finally, after very pain, this worked for me 1 get back up from your .git directory 2 open file

Update a local branch with the changes from a tracked remote branch

廉价感情. 提交于 2020-04-07 10:50:27
问题 I have a local branch named ' my_local_branch ', which tracks a remote branch origin/my_remote_branch . Now, the remote branch has been updated, and I am on the ' my_local_branch ' and want to pull in those changes. Should I just do: git pull origin my_remote_branch:my_local_branch Is this the correct way? 回答1: You have set the upstream of that branch (see: "How do you make an existing git branch track a remote branch?" and "Git: Why do I need to do --set-upstream-to all the time?" ) git

Update a local branch with the changes from a tracked remote branch

霸气de小男生 提交于 2020-04-07 10:50:26
问题 I have a local branch named ' my_local_branch ', which tracks a remote branch origin/my_remote_branch . Now, the remote branch has been updated, and I am on the ' my_local_branch ' and want to pull in those changes. Should I just do: git pull origin my_remote_branch:my_local_branch Is this the correct way? 回答1: You have set the upstream of that branch (see: "How do you make an existing git branch track a remote branch?" and "Git: Why do I need to do --set-upstream-to all the time?" ) git

How to use git flow without using release branch?

☆樱花仙子☆ 提交于 2020-03-02 09:28:29
问题 There are several branches available in git flow . such as feature/ release/ support/ hotfix/ bugfix/ I do not need release/ branch and want to merge staging branch ( a development branch ) directly to master . What is the best way to achieve this using git flow ? 回答1: I think this would be mandatory to make release branch for every release in production or your master branch So There is no alternative way to do this. Simply flow is as below: Work on your feature branch Finish work and merge

Force-delete a branch in Git? [duplicate]

拜拜、爱过 提交于 2020-02-21 10:20:47
问题 This question already has answers here : How to delete a local branch in git? (3 answers) Closed 3 years ago . I have created a branch test in my Git repository. Now I have no use for it. How can I force-delete this branch? I tried the following command: git branch -d test But it returns an error. 回答1: You can force-delete a branch with the following command: git branch -D test By replacing -d with -D , you are telling git to delete the branch and that you don't care to merge changes from

Force-delete a branch in Git? [duplicate]

断了今生、忘了曾经 提交于 2020-02-21 10:19:25
问题 This question already has answers here : How to delete a local branch in git? (3 answers) Closed 3 years ago . I have created a branch test in my Git repository. Now I have no use for it. How can I force-delete this branch? I tried the following command: git branch -d test But it returns an error. 回答1: You can force-delete a branch with the following command: git branch -D test By replacing -d with -D , you are telling git to delete the branch and that you don't care to merge changes from