How to clear the branch names from TortoiseGit - tortoisegit

In my git repo origin, i used to have the branches called "test" and "master". I removed the branch "test" from origin. And pushed a new branch "TEST". Notice that I basically removed the "test" with all small case and added a branch with all caps "TEST".
I ran "git fetch --prune" on my local machine. And then removed the branch test ("git branch -D test"). So, in my local i now have TEST and master branches. And i only see these 2 branches when i run "git branch" using git bash.
But, the issue i am seeing here is that, tortoise git is still showing the "test" branch that i already removed from my origin and local. Please help me in getting rid of the "test" branch from tortoise git as well. This is important for me, as there are other team members that use only tortoise git and not git bash and they see the same issue. So, i should atleast solve this issue for them.
Go to the directory of a git repo. Right click in the directory and you will see this menu.
Click on Git pull. You will see the following dialogue.
As you can see above, the Remote branch dropdown still displays "test"
if we click on git push from the first screenshot, this dialogue will appear.
And the remote dropdown in this case displays only "test" and not "TEST". Because of this, when people push this way, it is resulting in creation of a new branch called "test" in the origin, which is not intended.
I know we can manually type "TEST" for the remote branch before pushing. But, it would be nice if the "test" goes away which will prevent people from accidentally pushing to the wrong branch "test".

Selective removal: Mousehover an entry and then press shift+del.
Removing all settings: Go to TortoiseGit settings -> Saved Data and hit the appropriate clear button (cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-saved-data)

Related

xcode source control doesn't show current branch

I'm using the standard xcode source control (version 9.3)
I just reopened my project and when I go to the Source Control Navigator:
It shows a long hex string at the top instead of the current branch name
None of the branches have '(current)' next to them
I have tried cleaning the project and also closing and re-opening.
Source Control->Commit brings up the standard commit interface with the option to leave a comment.
When I click on the very top row (with blue icon) I can see the new commits but they don't show in any of the branches.
What am I doing wrong?
This worked for me:
I clicked on the row with the long hex name. This brought up the version history for the current version.
I right-clicked the most recent change in the change history.
I clicked 'Branch from...' and created a new branch from that point.
For those wondering how something like this could have happened, it is caused when you checkout a commit rather than checkout a branch. Even if you checkout a commit inside the branch that is "current" (even the most recent commit), this will cause the branch to no longer have the "current" written next to it. So when you are sure that this previous commit that you have now checked out is the commit you want to work with, then you must do what Derek posted to do which is to "Branch from..." to make a temporary branch and then merge this temporary branch into the branch that this previous commit originally came from. And then you can delete the temporary branch. It is somewhat of a pain, but a good reason why Xcode does this is so that you are well aware that you are on a previous commit and that you should really make sure this previous commit is what you want your current branch to be at.

XCode Git Head Detached

I'm new to programming so please dont bite my head off! I'm using Xcode with GitHub, but it's suddenly stopped working. Xcode is not showing the current branch on source control, it doesnt load remote repositories, and the git status is 'head detached'.
I've gone to the command line and done 'sudo git --version', and accepted the new license.
This project is for fun, but I've put a lot of work into it. I don't mind just losing the history of the project if need be, I'd just like to get GitHub's source control back to a working state. Any suggestions?
If you want to add commit with detached head to any branch you should use cherry-pick command
git checkout "branchname"
git cherry-pick "commitnumber"
Your screenshot is showing that you checked out a specific commit. The long hexadecimal number partially obscured by the red line in the screenshot is the commit number. When you check out a specific commit, you don't have a current branch so the git head is detached.
The fix is to check out a branch so you have a current branch again. Select a branch inside the Branches folder, the BrianTests branch in your screenshot, right-click, and choose Checkout.

Source control wiped project

I had a project I'd been working on and I wanted to start a new branch so that I could make edits without ruining the original
I went to source control, new branch.. etc. I ended up discarding all changes in the new branch but when I returned to the master branch, everything was gone. My files are still in the folder in finder but they arent showing up in xcode. My storyboard files when opened separately are blank.
Is there anyway to fix this?
If your changes are saved in remote repository, then you can pull all your changes for that branch from remote repository.
on master branch run this command
git pull origin master

How to change default action for "pushing" after committing?

After committing some code locally in TortoiseGit, the window that shows that the operation was successful offers to push the commit (or, in fact, any local commits) to a remote repository. This can be achieved by clicking a button with a dropdown arrow, from where Push, or some other actions can be chosen.
Normally, Push is shown by default, the other actions have to be selected from said dropdown menu.
I am now looking at a repository that was originally imported from SVN (using TortoiseGit). After importing all commits, I have manually reconfigured the remote master to point to a different, true Git repository.
However, after committing, the default action of the aforementioned button is always SVN DCommit for this repository, even after choosing Push several times.
How can I change the default action to Push?
The default of the post action button cannot be changed right now (as of version 2.3.4; see https://tortoisegit.org/issue/2227).
The "DCommit" entry is only shown for Git repositories which have an SVN remote. When you remove the SVN connection the default will be "Push".
Also, with a recent version of TortoiseGit the "OK" button of the commit dialog is a drop down menu where you can select "Commit & push" which should save you a click...

What is the purpose and function of Xcode's source control "Show Remote Status" menu option?

When working in Xcode on a project that's under git source control, I noticed the following menu item:
File > Source Control > Show Remote Status
and, when toggling it, it changes to:
File > Source Control > Hide Remote Status
I do have a Bitbucket git remote configured for the sample project I'm working on, but I can't figure out what that menu is supposed to be showing me, or where!? When I toggle it, there is no visible change to my Xcode user interface. I do have some changes that were committed to the local git repository only, not yet pushed to the remote, and I was expecting, somewhere, to see that the remote isn't current, when "Show Remote Status" is toggled on.
So, what is this "Remote Status" information that Xcode is supposed to be able to show, and where am I supposed to be looking for it? Is this feature equivalent to something that is typically queried on the git command line – and if so, what? Is there a window or panel I'm supposed to have open in order to see this information? I do have my navigator area, debug area, and utility areas all visible.
I searched Xcode documentation, Stack Overflow, and Google each for "Show Remote Status" and "Hide Remote Status", but none of the results were particularly enlightening.
I haven't used Xcode before (yet), but since Git is a distributed version control system, your local repo can become out of sync with the remote repo, i.e. their states can diverge. That is probably why you're given the option to see what the status of the remote is, for example, if any of its branches have been updated (i.e. have new commits), if there are any new branches on it, and if any branches have been deleted from it.
From the command line, you would normally get this kind of information by running git fetch --prune <remote> to update your local remote-tracking branches, which track the status of the branches of your remote (of course!). You can then examine the remote-tracking branches to see what the status of the remote repo is.
There is also the git ls-remote <remote> command, which will do a network operation to talk to the remote and return a list of the remote's current references/branches, but that is more of a plumbing command that is not really meant for typical Git users, it's more meant for Git developers to create Git tools.

Resources