How to remove sepcific files from commits in bitbucket using command line
I mistakenly committed some files ending with ~ (unsaved files on my local machine) repeatedly. c7b7b14
These contain files ending with .html~ or .js~ and I want to get rid off them and the files are already pushed ? How do we do that?(beginner)
See also questions close to this topic
Merge only before a number of pull request aproves
Someone know who can i configure a bitbucket branch to only accept a merge before a PR with a number of required approves?
PS: I'm at the moment with this branch configured to request approves to a PR (show a warning on merge) however, and with merge available only through a PR, anyone can merge before a pr open without approves.
Git hangs on push after Total
I have recently set up a VPS with Vultr and set up a remote git repository to upload my project.
After I add the remote to my local project and try to do the first push to it, it hangs after showing "Total 119 (delta 9), reused 0 (delta 0)".
To give a bit of context:
- the server is a fresh setup of Ubuntu 17.04 x64
- I have git version 2.14.1 locally
- I have already done this before on another VPS with Vultr (Ubuntu 16.04 x64) and everything worked fine
- The local git project is set up correctly as I have a remote on BitBucket where I could successfully push the project
- I have already tried to increase the buffer size, as recommended on other similar questions
- I am trying to upload a new, small Laravel project - no special or big files (every file is below 1MB)
- I have updated my git version to the latest available version (from 2.12 to 2.14), as recommended on other similar questions
- my SSH connection works fine and I have even set it up with Debug Level 3, so it is very verbose (I have the log below)
- the remote repository seems to be set up correctly (I have tried to create an additional remote, pointing to a non-existing repo on the same server, using the same SSH connection and I get a proper error message from GIT that it can not find the repo)
- I have set up the repo with and without --shared, but the result is the same
- I have even waited (over 8 hours) and nothing happened, no error message, it was still hanging
- I have tried every other solution I could find in 2 days on this topic and I still get the same result (even recreated my repo a few times, tried different names, tried chmod 777 for both my repo and my working directory on the server etc.)
Here is part of the verbose ssh output on git push (after it has verified the ssh keys):
debug3: send packet: type 50 debug3: receive packet: type 52 debug1: Authentication succeeded (publickey). Authenticated to 220.127.116.11 ([18.104.22.168]:22). debug2: fd 4 setting O_NONBLOCK debug2: fd 5 setting O_NONBLOCK debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug3: send packet: type 90 debug1: Requesting email@example.com debug3: send packet: type 80 debug1: Entering interactive session. debug1: pledge: network debug3: receive packet: type 80 debug1: client_input_global_request: rtype firstname.lastname@example.org want_reply 0 debug3: receive packet: type 91 debug2: callback start debug2: fd 3 setting TCP_NODELAY debug3: ssh_packet_set_tos: set IP_TOS 0x08 debug2: client_session2_setup: id 0 debug1: Sending command: git-receive-pack '/var/repo/hc-teaser.git' debug2: channel 0: request exec confirm 1 debug3: send packet: type 98 debug2: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug2: channel 0: rcvd adjust 2097152 debug3: receive packet: type 99 debug2: channel_input_status_confirm: type 99 id 0 debug2: exec request accepted on channel 0 Counting objects: 119, done. Delta compression using up to 4 threads. Compressing objects: 100% (104/104), done. Writing objects: 100% (119/119), 277.89 KiB | 5.91 MiB/s, done. Total 119 (delta 9), reused 0 (delta 0) debug2: channel 0: read<=0 rfd 4 len 0 debug2: channel 0: read failed debug2: channel 0: close_read debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug3: send packet: type 96 debug2: channel 0: input drain -> closed debug2: channel 0: rcvd adjust 65689
After this last line it just hangs indefinitely.
Pruning branches in Visual Studio 17 git?
I am very new to git and I gave GitHub integration in Visual Studio 2017. Everything is going well so far but whenever I do a pull request and merge branches I will delete the unused branch after the merge is complete on the web client. This works well but in Visual Studio, the branch I have deleted does not go away. I've seen other questions about this and the most common answer is to run the command
git config remote.origin.prune trueso when a fetch or pull is performed the repository will automatically prune the appropriate branches.
While I have no doubt that this will work I just don't know where to be running this. I've already tried running that in the windows CMD under the repository path (after right-clicking the repository in Visual Studio and selecting "open in Command Prompt") and it didn't throw any errors but also didn't seem to do anything at all after I ran through creating and merging another branch.
UPDATE: After looking into it a bit more I've realised the REMOTE/ORIGIN branch is being deleted but not the local one.
Is there a way to delete the branch locally automatically to match the remote?
Bitbucket Server & AD: User <username> does not exist
Our Bitbucket Server v5.4.0 is hooked up to our Active Directory. It uses a specialised user account to retrieve information from the AD. It is able to authenticate with this account.
However, in the second level of the Remote Directory test I receive the message:
"retrieve user" testen : Fehlgeschlagen User <username> does not exist
"Fehlgeschlagen" means "failed".
Authentication used to work. We have recently changed our Active Directory structure. In this process, we have also moved the folder with our Bitbucket User Group in it to a different subfolder (
CCDE\Groups\BitBucket). We have also changed these settings in our Bitbucket Server. We also updated to the newest version of Bitbucket Server.
Here are the settings we changed (I've left out those that were not changed, because those worked before):
Allowed operations: [UPDATE_GROUP_ATTRIBUTE, UPDATE_USER_ATTRIBUTE] Attributes: com.atlassian.crowd.directory.sync.lastdurationms: 62 com.atlassian.crowd.directory.sync.laststartsynctime: 1507267720419 ldap.basedn: OU=CCA,DC=domain,DC=companyname,DC=com ldap.group.dn: OU=BitBucket,OU=Gruppen ldap.user.filter: (&(objectCategory=Person)(sAMAccountName=*)(memberOf=CN=BitBucket_User,OU=BitBucket,OU=Gruppen,OU=CCA,DC=domain,DC=companyname,DC=com)) ldap.userdn: CN=bitbucket_ad_username,OU=Users,DC=domain,DC=companyname,DC=com
Allowed operations: [UPDATE_USER_ATTRIBUTE, UPDATE_GROUP_ATTRIBUTE] Attributes: crowd.sync.group.membership.after.successful.user.auth.enabled: true ldap.basedn: OU=CCDE,DC=domain,DC=companyname,DC=com ldap.group.dn: OU=BitBucket,OU=Groups ldap.user.filter: (&(objectCategory=Person)(sAMAccountName=*)(memberOf=CN=BitBucket_User,OU=BitBucket,OU=Groups,OU=CCDE,DC=domain,DC=companyname,DC=com)) ldap.userdn: email@example.com
I've anonymised some of the information. I've changed the LDAP User to the new format because I think it makes more sense. The user itself can authenticate, but it doesn't find any data about other Bitbucket users.
The users I'm trying to authenticate are all in the group
CCDE\Groups\BitBucket\BitBucket_User. None of them can authenticate in Bitbucket, but they can authenticate flawlessly in any other system, even the one I wrote myself.
I have also asked the same question in the Atlassian community yesterday, so far with no results.
Could anyone help me troubleshoot this problem? Thanks!
Adding a cordova plugin via ssh url results in wrong username
I want to add my cordova plugin which is in a private bitbucket repo. Therefore I want to use the SSH url which is the following:
As you can see the user is myuser.
If I now run
cordova plugin add git+ssh://firstname.lastname@example.org/myuser/cordova-plugin-xyz.git
I get the following error:
npm ERR! Command failed: git clone --template=/home/localuser/.npm/_git-remotes/_templates --mirror ssh://email@example.com/myuser/cordova-plugin-xyz.git /home/localuser/.npm/_git-remotes/ssh-git-bitbucket-org-myuser-cordova-plugin-xyz-git-160b6243 npm ERR! Klone in Bare-Repository '/home/localuser/.npm/_git-remotes/ssh-git-bitbucket-org-myuser-cordova-plugin-xyz-git-160b6243' ... npm ERR! repository access denied. npm ERR! fatal: Could not read from remote repository.
As you can see cordova tries to get the plugin by the url
gitas user which is wrong in my case.
Is there any way to change the user cordova uses? Is this a bug? Can I switch something in bitbucket so that it accepts the git user?
Thanks in advance.
git push to bitbucket fails immediately
With error Unable to lookup 'my bitbucket account' (port 9418) (A non-recoverable error occurred during a database lookup.) on a corporate bitbucket repository. It fails so quickly, it doesn't seem to be looking up anything. It almost feels like I need to clear out cache, but don't know if that's even possible.
It has worked in the past with no issues and seems to be all of a sudden. I can log into the repository with no problem. Error only happens on push, clone, or pull.