How do I delete a branch in sourcetree which has been deleted at source - atlassian-sourcetree

I am trying to delete a branch in Sourcetree which has been deleted on the source. I tried to use the delete branch with Force delete but got the following error message
git -c diff.mnemonicprefix=false -c core.quotepath=false
--no-optional-locks branch -D feature/PC-776_Scribante_Monthly_Journals_by_Branch error: Cannot
delete branch 'feature/PC-776_Scribante_Monthly_Journals_by_Branch'
checked out at 'D:/sourcegit' Completed with errors, see above.

The error occurred because I was in the branch to be deleted. Make sure you are in a different branch to the one you are trying to delete

Related

Able to commit in git but not able to push in git with ERROR: JIRA/RALLY_ID (USXXXX/DEXXXX/ESTC-XXXXX) is required in commit comment, not pushing

For a private project hosted in github, I am able to commit the message. I am unable to push the changes to remote. I get the following error. I have also tried with the command git commit --amend -m "JiraId: Msg" and after that I tried with the command git push --force. Still I always get the same below error message.
> remote: INFO: Checking commit message ...... remote: ERROR:
> JIRA/RALLY_ID (USXXXX/DEXXXX/ESTC-XXXXX) is required in commit
> comment, not pushing remote: TIPS: run git commit --amend to update
> commit comment and push again
It looks like a pre-receive server-side hook, which enforces you to use related issue key from Jira in the commit message, prior to pushing.
Jira is an issue tracker, and i'm assuming the work you are trying to push is described in a related issue (story, task...) in a Jira project.
Acceptable issue key format is: (USXXXX/DEXXXX/ESTC-XXXXX)
It may be one-of the above: US1234 or ESTC-9876
Or all as one: US1234/DEX5678/ESTC-3344
May/not include parentheses - (US1234) or (US1234/DEX5678/ESTC-3344)
You probably need to update the commit message with the actual issue key before be able to push it successfully to remote.
Try to asking org/repo admins about it.
Give it a try if you have actual related issue keys.

How to delete history of deleted commit?

I would like to find a way to remove commit history remaining in github.
I've fork a repository to do some work. I forgot to set config of name and email.
Therefore, for the first commit, it is pushed with incorrect credential.
I fix it by rebase, and the commit is deleted. I push again, so I cannot see that pushed in the git log.
However, the history of the first pushed is still shown in the github. This is because I refer to the issue number of the forked repository.
Is there a way to remove that history from github?
Here is a suggestion for how you could clean your history from this link:
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git#github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
git push -u --force origin master

"Commit failed - exit code 1 received" when trying to commit a new local reprository in gihub desktop

when I am trying to commit my new local repository at GitHub from GitHub-desktop it is throwing an error "Commit failed - exit code 1 received"
Regarding:
Check first if you have added files to your index.
Open the command line and check your git status.
Second, see desktop/desktop issue 3701:
some users have run into this error due to having nested .git directories.
Can you try searching your repository to see if you have multiple .git directories?
Had a .git in my repository (which I needed) and a .git in a subfolder (which I deleted), then it worked.
Finally, check if you have any submodule (a .gitmodules file at the root of your repo).
See desktop/desktop issue 1770.
If I commit changes in submodule myself than GitHub Desktop is able to push and/or commit changes after that. After submodule is committed manually SHA1 changes from dirty. At this point I can commit to main repo.
I removed the repository from GitHub Desktop (not from the disk) and then added it again as a local repository and this solved the issue for me.
I was receiving this error as well, but unlike others I did not have have any nested .git folders. When trying to view changes, each of the files appeared as "empty" until I removed the repository from GitHub Desktop and added it again.
I encountered the same thing and it's caused by .git in subfolder.
Just removed all related .git files and the error disappeared.
exitcode 1 while committing is not always a real "error".
i do not know GitHub-desktop (and which commands exactly be executed by GitHub-desktop) but maybe your problem has the same core-"problem" as my problem some days ago.
in my case i had a branch master which tracks/follows origin/master. i executed:
git pull --no-commit --no-ff
git commit -m "merge"
i found that if origin/master has no commits which can be pulled by the git pull-command then the git commit-command is obviously doing nothing because there are no staged changes and has (imo: surprisingly) the exit-code 1 although no error occurred.
(i guess git commit should have exitcode 0 if it has really created a commit).
Resolved.
I committed via cmd prompt and did not face this issue again.
For the Github desktop,click on the plus sign on the left-hand side of your Github desktop and then select 'Discard .git' files.

No submodule mapping found in .gitmodules for path 'server/simple_server'

Every time I do a git pull from SourceTree, I receive the following message:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree submodule update --init --recursive
No submodule mapping found in .gitmodules for path 'server/simple_server'
Completed with errors, see above
However, preceding the above message, the pull works as expected and everything is fine (code pulls, auto-merge, etc works as expected). This happens for every repo I've cloned using SourceTree. If I use the CLI to do a git pull, no submodule checks are performed and so I never see the above ('error') message. Why is SourceTree performing this extra step in the git pull (which does not happen from the CLI). I've gone through every possible option in SourceTree preferences.
I'm running SourceTree on a Mac now, but I had a (Windows) PC last week (and prior) running SourceTree and received the same errors – this appears to be a (default) feature of git pull in SourceTree, regardless of platform. And, once again, only happens via the GUI, not CLI – on all of my cloned repos.
Any advice would be appreciated. I hate seeing a false negative in my git pulls while using SourceTree.

GitHub Boxen Error

I'm not the biggest user of GitHub and when I try and install their new "boxen" (https://github.com/boxen/our-boxen) I'm having issues.
The README.md has instructions and I'm getting an error when running
git checkout -b master upstream/master
Any ideas? I created a local repo if that's any difference, or would I need to make one on GitHub?
Error message:
fatal: This operation must be run in a work tree