Error with commiting in sourcetree for bitbucket in windows - bitbucket

I am a new user of bitbucket(I want to be). I have created the repository, and I have configured sourcetree. However, when I want to commit the the files, I get an error as:
git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F
C:\Users\Amir_HO\AppData\Local\Temp\uupm1wem.ugf
*** Please tell me who you are.
Run
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'Amir_HO#AmiR.(none)')

easy, just go to the source of tree options, then advanced options Take away the check mark and enter a name and email, then you give ready ok and everything worked well.

Related

Why all my Xcode commits to Bitbucket show other user 'Author Name' on Bitbucket?

When I commit and push code to bitbucket, my bitbucket show some other Author name. I used :
~ mymac$ git config --global user.name "Myfirstname lastname"
:~ mymac$ git config --global user.email "myemail#abcd.com"
:~ mymac$ git config user.name "myusername"
:~ mymac$ git config user.email "myemail#abcd.com"
:~ mymac$ cat .git/config:
Above command show right email and password. But this will only work if I commit from terminal commands. However, in my case I am committing code directly from Xcode. Any Idea?
Hey guys fortunately I found the solution to this question: Xcode use your contact card from address book as Author name to all the commits. You can change whatever username/author name you want to show on Bitbucket/Git, follow this link
https://support.apple.com/kb/PH22743?locale=en_US
to make a contact as your contact card. Check screenshots also. Select any contact and make your contact card as displayed in screenshot.
Happy Coding!!!
------------------------------------------------------------------------

Code signing on Jenkins with remote Mac Mini

My configuration.
Jenkins server with the Keychains and Provisioning Profiles Plugin
Mac Mini as a remote build server
A personal Apple developer account.
Obviously I'm trying to get code signing working on the remote server.
I believe the fact that I have an individual Apple developer account means I cannot issue "permission" for other developers to work on my project and that the node can't just have it's own Apple ID.
Following the plugin instructions I believe the "provisioning profiles" section is correct.
The keychains are apparently not working. At first I uploaded .cert and .p12 files and it errored on upload. Then I uploaded my entire login.keychain which it successfully parsed. I give it the keychain password. I got the "identity" string by stealing it from the "info" section when right clicking on the key in the keychain manager; "iPhone Developer: William Guynes (XXXXXXXXXX)". Past the successful upload I have no way to knowing whether the other two fields are correct. I believe the password desired is the login.keychain password but the field description is a bit vague. I found a partial blurred example of the "identity" string but I'm guessing about where to get it.
This is not a case of my key being my username and Jenkins using "Jenkins" username. When the job is pushed off to the remote it runs as a user with the name of "ci". I can give ci any permissions needed, including directly manipulating its keychains. I haven't gotten that to work but I feel that a workaround hack like this shouldn't be necessary with the plugin in the first place.
Current build output:
Console Output
Started by user William Guynes
Building remotely on mini (osx) in workspace /Users/ci/workspace/websocketclient
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url ssh://lion.guynes.net/var/git/WebSocketClient.git/ # timeout=10
Fetching upstream changes from ssh://lion.guynes.net/var/git/WebSocketClient.git/
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress ssh://lion.guynes.net/var/git/WebSocketClient.git/ +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 51c15eabd01c443ef6fee24cc755af60f706a4f0 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 51c15eabd01c443ef6fee24cc755af60f706a4f0
> git rev-list 51c15eabd01c443ef6fee24cc755af60f706a4f0 # timeout=10
[websocketclient] $ /bin/bash /var/folders/54/kvd8ytzd6yl3d2y7zdxf_ygw0000gp/T/hudson2702132375138804077.sh
Executing do/all
Executing do/setup
Executing do/build
=== BUILD TARGET WebSocketClient OF PROJECT WebSocketClient WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Executing do/test
Finished: SUCCESS
I have spent a full day googling and trying to find an answer. Many links lead back to this blog post but it describes manually copying the provisioning file and moving the keys from "login" to "System." Itdoesn't take into account a remote server. It appears to be a temporary hack to work around the problem that the plugin was designed to resolve in the first place!
I could see the provisioning profile being copied into the correct path by the plugin.
I could also see that it copies the login.keychain provided to the workspace/{jobname} root directory.
The ci user needed that login.keychain added to its search path.
plugin provided keychain
ci user's keychain
system keychain
So I altered my build script.
system_keychain='/Library/Keychains/System.keychain'
keychain_list=$(security list-keychains)
echo "${keychain_list}" | grep "${KEYCHAIN_PATH}"
ec=$?
if [[ ${ec} -ne 0 ]]
then
new_keychain_list=(
${KEYCHAIN_PATH}
$(echo "${keychain_list}" | grep -v "${system_keychain}")
)
echo "Setting keychains to" ${new_keychain_list[*]}
security list-keychains -s ${new_keychain_list[*]}
fi
If the provided keychain isn't already in the search path then add it to the beginning. The system is always tacked onto the end when setting it so strip it out before performing a set.

fatal: No existing author found with 'XXX'

I used git for the first time and I set my user name and user mail. The commands I used are below:
git config --global user.email "bob#example.com"
git config user.email "bob#example.com"
git config --global user.name "bob"
git config user.name "bob"
When I run git commit --author "bob" , I got an error fatal: No existing author found with 'bob'. How can I set user name and email?
You should stop using --author each time you commit, and instead configure an author with git config. Once you've done so, you can type git commit and the author will be pulled from your .gitconfig file.
If you want to give --author a name to use for authoring the commit, you need to use
bob <bob#example.com>
not just bob. If your author string doesn't match the user <user#example.com> format, Git assumes you've given it a search pattern, and it will try to find commits with matching authors. It will use the first found commit's user <user#example.com> as the author.
This command will do the trick:
git commit --amend -C HEAD --reset-author
Note: starting with Git 2.3.1+ (Q1/Q2 2015), the error message will be more explicit.
See commit 1044b1f by Michael J Gruber (mjg):
commit: reword --author error message
If an --author argument is specified but does not contain a '>' then git tries to find the argument within the existing authors; and gives the error message "No existing author found with '%s'" if there is no match.
This is confusing for users who try to specify a valid complete author
name.
Rename the error message to make it clearer that the failure has two
reasons in this case.
The solution remains to have the config user.name and user.email properly set, but for the case where --author is used, at least the expected argument is now clearer.
So run:
git add --all ; git commit -m "$git_msg" \
--author "First Last <first.last#company.com>"; git push

git checkout master command gives error that a file would be overwritten

I just made tried to do git checkout master and I got this error:
macoss-MacBook-Pro-10:Marketing owner12$ git checkout master
error: The following untracked working tree files would be overwritten by checkout:
Marketing.xcodeproj/project.xcworkspace/xcuserdata/owner12.xcuserdatad/UserInterfaceState.xcuserstate
Please move or remove them before you can switch branches.
Aborting
but I am not sure how to handle this situation. I don't mind having this file overwritten by what is in the repo. What is the correct way for me to proceed here?
Thanks!
You have files that are not being tracked. Either
rm untracked.file1 untracked.file2
or
git add . && git commit -m "adding new previously untracked files that serve a purpose"
if you're having permission issues:
git add --ignore-errors .
Either delete the file if you don't care about it or stash it if you think you will need it in the future. Or simply rename.
Commit the files you want to keep and then do a git clean to remove the extra files you don't want to keep. This article on the git ready website describes it very well.
If you just want to get rid of one or two files in your working directory then you can do a dry run first and see which files would be cleaned up using:
git clean -n
And then when you are sure do this:
git clean -f
git clean has a -d switch if you want to clean up directories as well. And you can use that together with the other switches, so this is what I would normally use (and then after the dry run change -n to -f):
git clean -n -d
Then after your git clean, use:
git status
to make sure that you have no untracked files or uncommitted changes. And lastly switch to master with:
git checkout master

What does the git error mean "pathspec did not match any file(s)"

In a Rails app I realised I had committed a sensitive file config/credentials.yml to the git repo.
In an effort to tidy things up I followed the advice on GitHub and ran
git filter-branch --index-filter 'git rm --cached --ignore-unmatch config/credentials.yml' --prune-empty --tag-name-filter cat -- --all
and then added to gitignore
echo "config/credentials.yml" >> .gitignore
When I try to commit these changes
git add .gitignore
git commit -m "ignored credentials.yml"
I'm getting a message
error: pathspec 'adds credentials.yml to gitignore' did not match any file(s) known to git.
How can I fix this error? Or, how can I undo my changes and safely revert to the git history on my remote?
I think you might've forgotten the step
$ git add .gitignore
before trying to commit, or then you mistyped, when you shoud've given
$ git commit -m "Add credentials.yml to .gitignore"
Process advised is highly dangerous [for the repo contents], so one must be really careful to follow all the steps in detail.
Just give a file path while adding file to git add command, it works for me
$ git add mainFolder/.../file.extension
Note: mainFolder would be the folder inside your repo

Resources