Git bash on Windows 10 no longer works with Bitbucket since the March 2022 App Password change from Atlassian - passwords

I have read 100's of posts and tried dozens of things, give or take, to get Windows 10 and my git bash push to work with the Bitbucket Cloud and their App password mandate enforced on March 1st 2022. I decided to reach out to the stack team before I harm a monitor, laptop or myself. 10 hours in and I give up. Mea Culpa.
Using git bash:
$ git push -u origin master
Gets me:
remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details:
https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal
settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/myWorkspace/myRepo.git/'
Windows 10
git bash version 2.35.1.windows.2
using bitbucket web interface to view my repositories and add app
passwords --- https://bitbucket.org/
My bitbucket account has my work email address and a username associated with it.
I have a Bitbucket Cloud workspace, project and repository that I have been pushing into for several years.
I have used both Visual Studio and Git Bash to access this repository.
I did not create the repository. Our company admin did.
I am the only user of the repository and the only userid that has ever pushed to it.
Both access methods VS2019 and Git Bash quit working for me around Mar. 10th when I tried my first Commit and Push since Dec2021.
Since my first error on March 10th.
I have added an app password via bitbucket web interface by:
1 - Left click my avatar lower left of bitbucket web page
2 - Select Personal Settings
3 - Select App Passwords on the left
4 - Click Blue Create App Password button
5 - Labeled it: GitBash
6 - Selected all the permissions below -
Account
x - Email
x - Read
x - Write
Workspace membership
x - Read
x - Write
Projects
x - Read
x - Write
Repositories
x - Read
x - Write
x - Admin
not - Delete
Pull requests
x - Read
x - Write
7 - Then hit the blue Create button.
8 - I then got the screen that displayed the 20 char password. I copied it to notepad temporarily and then put it in the git command below:
$ git remote set-url origin https://myUserid:myAppPassword1234567#bitbucket.org/my-workspace/myrepo.git
I then try my push again:
$ git push -u origin master
and get the response:
remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/myWorkspace/myRepo.git/'
$ git config --global --list
core.editor="C:\Users\first last\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait
user.name=myUserid
user.email=myUserid#myCompany.com
credential.bitbucketauthmodes=basic
credential.microsoft.visualstudio.com.authority=BitBucket
difftool.sourcetree.cmd='' "$LOCAL" "$REMOTE"
mergetool.sourcetree.cmd=''
mergetool.sourcetree.trustexitcode=true
$ git remote -v
origin https://myUserid:myAppPassword1234567#bitbucket.org/my-workspace/my-repo.git
(fetch)
origin https://myUserid:myAppPassword1234567#bitbucket.org/my-workspace/my-repo.git
(push)
The output from the remote -v is exactly as I set it up with the $ git remote set-url command.
$ git config --list
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
credential.helper=manager-core
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true core.autocrlf=true core.fscache=true
core.symlinks=false pull.rebase=false
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master core.editor="C:\Users\my-first Wilson\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait
user.name=bwilson user.email=myUserid#myCompany.com
credential.bitbucketauthmodes=basic
credential.microsoft.visualstudio.com.authority=BitBucket
difftool.sourcetree.cmd='' "$LOCAL" "$REMOTE"
mergetool.sourcetree.cmd='' mergetool.sourcetree.trustexitcode=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
submodule.active=.
remote.origin.url=https://myUserid:myAppPassword1234567#bitbucket.org/myWorkspace/myRepo.git
remote.origin.fetch=+refs/heads/:refs/remotes/origin/
C:\Users<username>.git-credentials
has one record in it:
https://myUserid:myAppPassword1234567#bitbucket.org
I have been coding for decades but haven't done a lot with git and bitbucket so I'm sure this is me, but I could use some help. I will answer any questions, run any tests and provide any results. Thanks!

Related

intellij repository clone failed: Authentication failed

versiont Control > GitHub > "Test Successufl"
IMG1
Git version : 2.18.0
SSH ececutable: Native
IMG2
BUT!!
git clone fail
IMG3
I don't know why this happens any help would be appreciated.
You are cloning via HTTP. SSH executable is not related.
Check if it works in the command line first. It could happen there is git credential.helper that somehow saved wrong credentials and git is trying to use them.
You could use SSH instead, but make sure SSH keys are registered on GitHub and, since you want to use native SSH client, the key is added to ssh-agent or does not have a passphrase, because IntelliJ is not a terminal and cannot handle interactive prompts for passphrases.
Everybody Thanks~
I resolved it in the following way.
Step 1. Create SSH Key (in Local PC)
My PC use Windows.
So, I use Git Bash.
Step 2. Register GitHub
Personal settings > SSH and GPG Keys
Nes SSH Key > XXX_rsa.pub (This contens is Created SSH Key File in Local PC)
Step 3. In intellij, Git Clone used "Use SSH" instead of "Use HTTPS".

How do I add certificates for OS X Server 3.2.1 with Xcode 6.0.1

After I have upgraded both Xcode (to 6.0.1) and OS X Server (to 3.2.1) I can't figure out how to add certificates for the provisioning profiles so the Xcode bot can find them.
I have successfully added the provisioning file by copying the .mobileprovision file to /Library/Developer/XcodeServer/ProvisioningProfiles
But the error I get in the log is now:
CodeSign /Library/Developer/XcodeServer/Integrations/Caches/017d83d8975db54bc8279c2fcc0304a6/DerivedData/Build/Products/Server\ build-iphoneos/Test.app
cd /Library/Developer/XcodeServer/Integrations/Caches/017d83d8975db54bc8279c2fcc0304a6/Source/TEST
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Signing Identity: "iPhone Distribution: Greener Pastures ApS"
Provisioning Profile: "Greener Pastures Enterprise TEST"
(03F7CD73-FB25-422E-22A4-A80F12041005)
/usr/bin/codesign --force --sign 746ADC85C62D54BEC9FA874A8D777A38D4DB95CA --keychain /Library/Developer/XcodeServer/Keychains/Portal.keychain --resource-rules=/Library/Developer/XcodeServer/Integrations/Caches/017d83d8975db54bc8279c2fcc0304a6/DerivedData/Build/Products/Server\ build-iphoneos/Fnug.app/ResourceRules.plist --entitlements /Library/Developer/XcodeServer/Integrations/Caches/017d83d8975db54bc8279c2fcc0304a6/DerivedData/Build/Intermediates/Fnug.build/Server\ build-iphoneos/Fnug.build/Fnug.app.xcent /Library/Developer/XcodeServer/Integrations/Caches/017d83d8975db54bc8279c2fcc0304a6/DerivedData/Build/Products/Server\ build-iphoneos/Fnug.app
746ADC85C62D54BEC9FA874A8D777A38D4DB95CA: no identity found
Command /usr/bin/codesign failed with exit code 1
Which looks like: "I can't find the certificate for the specified provisioning profile".
And it looks like the certificate should be in the file /Library/Developer/XcodeServer/Keychains/Portal.keychain – which, unfortunately I am unable to edit.
I have tried adding the certificate to the file by using
sudo security import "/Users/administrator/Desktop/Greener Pastures Enterprise Distribution TEST Certificate.p12" -k /Library/Developer/XcodeServer/Keychains/Portal.keychain -A -T /usr/bin/codesign -T /usr/bin/xcodebuild -T /usr/bin/pkgbuild
But that prompts me for the "keychain password". Which I don't have (no, it is not the administrator account's password or the certificate password).
Does anyone know how to fix this?
Try to add your server to the developer portal first and remove all restrictions like explicit provisioning files from your project.
If this doesn't work, file a Radar explaining your configuration and why you think it should be supported by Apple.
If you are really, really sure it's a good idea to hack your server, possible breaking it, open a terminal on your server from an account with administrator privileges and:
Copy the Portal keychain to your desktop:
> sudo cp /Library/Developer/XcodeServer/Keychains/Portal.keychain ~/Desktop/
Password: your-administrator-password
> sudo chown `whoami`:staff ~/Desktop/Portal.keychain
Set the Portal keychain password to “123”
> security set-keychain-password -o "`sudo cat /Library/Developer/XcodeServer/SharedSecrets/PortalKeychainSharedSecret`" ~/Desktop/Portal.keychain
New Password: 123
Retype New Password: 123
Open the Keychain in Keychain Access:
> open -b com.apple.keychainaccess ~/Desktop/Portal.keychain
Unlock the “Portal” keychain using password “123”
Copy the needed keys from your personal “login” keychain to the “Portal” keychain.
Make sure the private keys have the right access rights (in the “Access Control” tab), “xcsbuildd”, “xcscontrol”, “xcodebuild” and “codesign” should be listed
Lock the “Portal” keychain, quit “Keychain Access”
Reset the Portal keychain password:
> security set-keychain-password -p "`sudo cat /Library/Developer/XcodeServer/SharedSecrets/PortalKeychainSharedSecret`" ~/Desktop/Portal.keychain
Password: your-administrator-password (optional step)
Old Password: 123
It may or may not ask you for your administrator password again, pay attention to the prompt.
Copy the Portal keychain back
> sudo chown _xcsbuildd:_xcs ~/Desktop/Portal.keychain
> sudo cp ~/Desktop/Portal.keychain /Library/Developer/XcodeServer/Keychains/
Since the system caches open keychains, restart you computer.
Don't just blindly copy keys to the Portal keychain. Try other solutions first and ask on stack overflow if you need help. Only follow this procedure after filing a Radar, not just because “things don't work”. You will destroy your system when you are not exactly sure what you're doing here.
Alternate procedure (for the advanced):
Copy the following script as importP12.sh:
#!/bin/sh
importP12()
{
P12FILE="$1"
XCS="/Library/Developer/XcodeServer";
XCBIN="$XCS/CurrentXcodeSymlink/Contents/Developer/usr/bin";
PORTALKC="$XCS/Keychains/Portal.keychain"
PORTALKCS="$XCS/SharedSecrets/PortalKeychainSharedSecret"
sudo security -i <<IMPORT
unlock-keychain -p "`sudo cat $PORTALKCS`" $PORTALKC
import "$P12FILE" -k $PORTALKC -T "$XCBIN/xcsbuildd" -T "$XCBIN/xcscontrol" -T "$XCBIN/xcodebuild" -T /usr/bin/codesign
lock-keychain $PORTALKC
IMPORT
}
echo "Please enter your account password:"
for p12 in "$#"
do
importP12 "$p12"
done
And do
> importP12.sh your-P12-file.p12
Password: your-administrator-password
A dialog asking you for the P12 import password should appear and you are set.
This answer from Matt Moriarity brought me to a solution: https://devforums.apple.com/message/1022214#1022214
I just re-connected the build server with our development team. This made the Xcode-service to re-initialize all certificates and provisioning profiles it needs. Now the integration builds run without errors.
In Server > Xcode > Settings > Builds > Development Teams click on Edit...
Remove your development team(s) from the list and press OK
After ther Server.app finished its work, there should be no entry behinde "Development Teams" and the list of devices is also empty.
Now open Server > Xcode > Settings > Builds > Development Teams > Edit... again and add your development team
After your team and devices re-appeared, you can start the integration build
It's important not to use your own provisioning profiles. Take the "iOS Developer (Automatic)" setting.
If you had it working with the old osx server and xcode 5. You just do:
$ mv /Library/Developer/XcodeServer/Keychains/Portal.keychain /Library/Developer/XcodeServer/Keychains/Portal.keychain.bkp
$ ln -s /Library/Keychains/System.keychain /Library/Developer/XcodeServer/Keychains/Portal.keychain
The old server used the system keychain.
When you export a .p12 file Keychain Access will ask you for a password. Try adding the password for the p12 file to your command. Like so,
sudo security import "/Users/administrator/Desktop/Greener Pastures Enterprise Distribution TEST Certificate.p12" -P PASSWORD -k /Library/Developer/XcodeServer/Keychains/Portal.keychain -A -T /usr/bin/codesign -T /usr/bin/xcodebuild -T /usr/bin/pkgbuild
I have a script on our build server that imports p12 files from a drop off folder. The import line looks like this:
security import $_ -k /Library/Developer/XcodeServer/Keychains/Portal.keychain -P PASSWORD -A
I had the same issue. I fixed it through the following methods :
Xcode > Preferences > Accounts > View Details > And just refresh the Provisioning Profile
Then Restart the Xcode and Clean & Build.
For OX X Server 4.0 and XCode 6.1 is a much easier way:
Open your Project with XCode on the Server add your Developer Account to "Accounts" and download all required provisioning profiles.
Copy your Privisioning Profiles from /Users//Library/MobileDevices/Provisioning Profiles/ into /Library/Developer/XcodeServer/ProvisioningProfiles/
Give read and write access for administrators for the folder /Library/Developer/XcodeServer/ProvisioningProfiles/
Open KeyChaine Access double click on the provisioning profile keys (for example iOS Developer: XY) and allow access for all apps.
Done.
Install certificates(*.p12) to keychain on machine with Xcode server
In Keychain.app copy "Login-My Certificates" to "System-My Certificates"

Gitlab - Push with to remote not working

I installed Gitlab 6 on my MBP running OS X 10.8.5 and works fine. I can create projects, users, commit, push ... But only from there.
I try to push project from my iMac ( I do git config, init, add, commit), I generated also the ssh keys.
When a test the connection : ssh -T git#my_server it gives "Welcome to Gitlab, Anonymous".
but when I issue the push -u origin master I've got :
Blockquote
Access denied
Fatal: Could not read from remote repository
Please make sure you have the correct access rights and the repository exists.
Blockquote
Is it something relating with SSH or with Gitlab itself ?
In Gitlab 6 a added a 2d key to the project, my public key (generated on the iMac).
On my MBP I added the content of the id_rsa.pub (iMac) to the authorised_keys and known_hosts files (MBP)
Thank.

dotcloud push on cygwin fails with "rsync error: unexplained error (code 255)" (similar with git and hg)

Though I have followed the usual steps for using the dotCloud CLI under Cygwin, dotcloud push fails in all cases: --rsync, --hg, and --git.
I am on Windows 8 and Cygwin.
How can I push successfully?
Sample output:
me#host /cygdrive/d/project
$ dotcloud push --rsync
==> Pushing code with rsync from "./" to application myapp
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
me#host /cygdrive/d/project
$ dotcloud push --git
Permission denied (publickey,password).r from "./" to application myapp
fatal: The remote end hung up unexpectedly
me#host /cygdrive/d/project
$ dotcloud push --hg
==> Pushing code with mercurial from "./" to application myapp
abort: no suitable response from remote hg!
Error: Mercurial returned a fatal error
You may be running into a bug in Cygwin's group permissions. Vineet Gupta gives a workaround in his blog. The problem comes from the very strict permissions expected by ssh around the keys, and the solution is to set the permission on the ssh key properly (to 600, rw by owner only). Cygwin seems to need the group to be added manually.
Updating the steps to get the dotCloud CLI installed, including setting the permissions, leads to:
Start the Cygwin Setup.
Select default choices until you reach the package selection dialog.
Enable the following packages:
net/openssh
net/rsync
devel/git
devel/mercurial
python/python (make sure it’s at least 2.6!)
web/wget
After the installation, you should have a Cygwin icon on your desktop. Start it: you will get a command-line shell.
Download easy_install
wget http://peak.telecommunity.com/dist/ez_setup.py
Install easy_install
python ez_setup.py
You now have easy_install; let’s use it to install pip:
easy_install pip
Now install dotcloud (the CLI)
pip install dotcloud
Set up the CLI with your credentials. This will also download the ssh key.
dotcloud setup
New Step Update the permissions on your dotCloud key:
chgrp Users ~/.dotcloud_cli/dotcloud.key
chmod 600 ~/.dotcloud_cli/dotcloud.key
Now you should be able to dotcloud push
If you have multiple dotCloud accounts, then you will need to repeat this process for each account, since each account has its own key. Also note that you shouldn't have to set these permissions manually, but it seems like the group ownership is sometimes the wrong default in Cygwin. Linux and OSX don't seem to show this problem, though the permissions must be 600 for all OSes, so it is worth checking.

How To Upload Files on GitHub

I have recently downloaded GitHub and created a repository on it. I am trying to upload an Objective C project in it. How do I go about doing this?
I didn't find the above answers sufficiently explicit, and it took me some time to figure it out for myself. The most useful page I found was:
http://www.lockergnome.com/web/2011/12/13/how-to-use-github-to-contribute-to-open-source-projects/
I'm on a Unix box, using the command line. I expect this will all work on a Mac command line. (Mac or Window GUI looks to be available at desktop.github.com but I haven't tested this, and don't know how transferable this will be to the GUI.)
Step 1: Create a Github account
Step 2: Create a new repository, typically with a README and LICENCE file created in the process.
Step 3: Install "git" software.
(Links in answers above and online help at github should suffice to do these steps, so I don't provide detailed instructions.)
Step 4: Tell git who you are:
git config --global user.name "<NAME>"
git config --global user.email "<email>"
I think the e-mail must be one of the addresses you have associated with the github account. I used the same name as I used in github, but I think (not sure) that this is not required. Optionally you can add caching of credentials, so you don't need to type in your github account name and password so often. https://help.github.com/articles/caching-your-github-password-in-git/
Create and navigate to some top level working directory:
mkdir <working>
cd <working>
Import the nearly empty repository from github:
git clone https://github.com/<user>/<repository>
This might ask for credentials (if github repository is not 'public'.)
Move to directory, and see what we've done:
cd <repository>
ls -a
git remote -v
(The 'ls' and 'git remote' commands are optional, they just show you stuff)
Copy the 10000 files and millions of lines of code that you want to put in the repository:
cp -R <path>/src .
git status -s
(assuming everything you want is under a directory named "src".) (The second command again is optional and just shows you stuff)
Add all the files you just copied to git, and optionally admire the the results:
git add src
git status -s
Commit all the changes:
git commit -m "<commit comment>"
Push the changes
git push origin master
"Origin" is an alias for your github repository which was automatically set up by the "git clone" command. "master" is the branch you are pushing to. Go look at github in your browser and you should see all the files have been added.
Optionally remove the directory you did all this in, to reclaim disk space:
cd ..
rm -r <working>
Well, there really is a lot to this. I'm assuming you have an account on http://github.com/. If not, go get one.
After that, you really can just follow their guide, its very simple and easy and the explanation is much more clear than mine: http://help.github.com/ >> http://help.github.com/mac-set-up-git/
To answer your specific question: You upload files to github through the git push command after you have added your files you needed through git add 'files' and commmited them git commit -m "my commit messsage"
You need to create a git repo locally, add your project files to that repo, commit them to the local repo, and then sync that repo to your repo on github. You can find good instructions on how to do the latter bit on github, and the former should be easy to do with the software you've downloaded.
To upload files to your repo without using the command-line, simply type this after your repository name in the browser:
https://github.com/yourname/yourrepositoryname/upload/master
and then drag and drop your files.(provided you are on github and the repository has been created beforehand)
Here are the steps (in-short), since I don't know what exactly you have done:
1. Download and install Git on your system: http://git-scm.com/downloads
2. Using the Git Bash (a command prompt for Git) or your system's native command prompt, set up a local git repository.
3. Use the same console to checkout, commit, push, etc. the files on the Git.
Hope this helps to those who come searching here.
if you're on windows:
http://windows.github.com/
otherwise:
http://git-scm.com/downloads/guis
If you want to upload a folder or a file to Github
1- Create a repository on the Github
2- make: git remote add origin "Your Link" as it is described on the Github
3- Then use git push -u origin master.
4- You have to enter your username and Password.
5- After the authentication, the transfer will start