No author information was supplied by the version control system - swift

I just updated my Xcode to version 10.2 (10E125).
A moment I want to commit, I get this message:
After I click on fix:
I have filled in the information, but I’m still getting that message above.
What's the reason?

You can set the author information using Terminal. It might be possible that xCode has the author data but it's not actually set in Git config.
Setting your Git username for every repository on your computer
1) Open Terminal.
2) Set a Git username:
$ git config --global user.name "Mona Lisa"
3) Confirm that you have set the Git username correctly:
$ git config --global user.name
> Mona Lisa
Setting your Git username for a single repository
1) Open Terminal.
2) Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.
3) Set a Git username:
$ git config user.name "Mona Lisa"
4) Confirm that you have set the Git username correctly:
$ git config user.name
> Mona Lisa
Source: https://help.github.com/en/articles/setting-your-username-in-git

Click on "Fix" and provide your Git username and email. This fixed my issue.

Related

Extract Git URL from file using Powershell

1/ I need to extract in a folder a specific part of url. The url is in the subfolder named ".git" and I use the command:
git remote get-url --all origin
url look like this:
- git#servername:do-amont/production/ei2/nova/migration-devfactory.git
- ssh://servername.domain.com:30272/do-amont/production/ei2/nova/migration-devfactory.git
- https: //gitlab-review-dev-jxuor3.openshift-intra-dev.domain. com/do-amont/production/ei2/nova/migration-devfactory.git
the part I need is
do-amont/production/ei2/nova/migration-devfactory.git
After that I need to put the extracting url on this command
git remote set-url --add origin ssh://git#l203ei3007.domain.com:30272/do-amont/production/ei2/nova/migration-devfactory.git
I need to automatise these step on powershell
You can get the URL from the git config for a specified remote via the git config git command-line command, as long as you run it from within the directory with the .git folder.
So you could do something like this (assumes the part of the URL you want to keep is always after a colon):
$GitURL = (git config remote.origin.url).split(':')[1]
git remote set-url --add origin "ssh://git#l203ei3007.domain.com:30272/$GitURL"

Cannot clone git repository in command line script task in Azure DevOps Pipelines

I created azure devops pipeline where I need to download code from another git repository. As per recommended solution I've read somewhere, I added a command line script task with git clone command. Unfortunatelly this doesn't work.
The error that I get is:
remote: TF200016: The following project does not exist: My0Test0Project. Verify that the name of the project is correct and that the project exists on the specified Azure DevOps Server.
fatal: repository 'https://dev.azure.com/myCompany/My0Test0Project/_git/Service.Azure.Core/' not found
My project in Azure has spaces, maybe there is a bug in azure related to that? Does anybody knows any workarounds?
This is some code that I have tried already:
git -c http.extraheader="AUTHORIZATION: Basic bXl1c2VyOmxtNjRpYTYzb283bW1iYXp1bnpzMml2eWxzbXZoZXE2azR1b3V2bXdzbnl5b3R5YWlnY2E=" clone https://dev.azure.com/myCompany/My%20Test%20Project/_git/Service.Azure.Core
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" clone https://dev.azure.com/myCompany/My%20Test%20Project/_git/Service.Azure.Core
git clone https://oauth:lm64ia63oo7mmbazunzs2ivylsmvheq6k4uouvmwsnyyotyaigca#dev.azure.com/myCompany/My%20Test%20Project/_git/Service.Azure.Core
git clone https://test:$(System.AccessToken)#dev.azure.com/myCompany/My%20Test%20Project/_git/Service.Azure.Core
The reason is because you need to add the system access token so that Azure can have access to the external repo. (your credentials need access to that repo)
NOTE:
I wrapped my URL in quotes to escape the % signs in the URL string because Powershell treats those as variables otherwise.
- powershell: |
git clone -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" "https://{YOUR PIPELINE URL}"
displayName: '{YOUR PIPELINE NAME}'
I had the same issue from a bash script and solved it by escaping the % character with %%.
So, you can use this :
git clone https://test:$(System.AccessToken)#dev.azure.com/myCompany/My%%20Test%%20Project/_git/Service.Azure.Core
Can you try to change your Command Line task to something like this one?
git clone --single-branch --branch $(branchName) https://$(gitUserName):$(gitPassword)#dev.azure.com/myCompany/My%20Test%20Project/_git
Where $(gitUserName) and $(gitPassword) configured as Alternate git credentials in
your Azure DevOps account.
Also wanted to ask about ending of git repository URL:
".../_git/Service.Azure.Core", you are trying to specify which folder to clone or maybe working directory? You can also try your previous code without that ending, just
https://dev.azure.com/myCompany/My%20Test%20Project/_git
I tried this from Powershell task and it worked
Its very simple just use
- powershell: |
git config user.email "$(Build.RequestedForEmail)"
git config user.name "$(Build.RequestedFor)"
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" clone https://<org_Name>.visualstudio.com/<project_name>/_git/<repository_name>;
displayName: "<your task display name>"
This will happen when your path has space characters in it.
The workaround for this is to not use %20 in your URL and use actual space characters instead. Since your URL now has space characters, also make sure that your URL is wrapped inside double quotes.
So your
git clone https://dev.azure.com/myCompany/My%20Test%20Project/_git/Service.Azure.Core/
should be
git clone "https://dev.azure.com/myCompany/My Test Project/_git/Service.Azure.Core/"

Pushing entire Rundeck configuration to github

I want to push entire Rundeck configuration to Github. Is there any way for doing this ?
Considering the Rundeck configuration layout, all you would need to do is:
cd $RDECK_BASE
git init .
git remote add origin /url/new/empty/GitHub/repo
echo '*'>.gitignore
echo '!/etc/'>.gitignore
echo '!/server/'>.gitignore
echo '/server/*'>.gitignore
echo '!/server/config/'>.gitignore
git add .
git commit -m "Rundeck config"
git push -u master
Basically, you need to ignore what is not configuration before adding everything else (ie, the config files), and pushing to your own GitHub repo.
Make sure those files don't have sensitive credential information in them though (or at least push them to a private GitHub repo if you have one)

How can I change my commit to correct user in github?

At the beginning, I used other's account to do my work on github. Then my account is added into the organization, so I changed my account by using:
git config --global user.email "me#here.com"
In the commit page or issue page of any branch, the author is right. But in my dashboard, the commits is not mine. How can I solve that? Thanks!
From the GitHub Help page "Set up Git":
Username
First you need to tell git your name, so that it can properly label
the commits you make.
$ git config --global user.name "Your Name Here"
# Sets the default name for git to use when you commit
You have only set your email, but first you should have set your name. That's probably why the author is not the right one in the dashboard.
EDIT
Since you already set your username as I suggested, you need to modify GIT_COMMITTER_NAME or GIT_AUTHOR_NAME variables.
In order to do so open a shell in your repository (if you're on Windows set the PowerShell as the predefined shell first from tools->options, so you can copy/paste in it) and type the following:
git filter-branch --env-filter '
Then open any texteditor and copy/paste the following in it:
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your#email.to.match" ]
then
cn="Your New Committer Name"
cm="Your New Committer Email"
fi
if [ "$GIT_AUTHOR_EMAIL" = "your#email.to.match" ]
then
an="Your New Author Name"
am="Your New Author Email"
fi
export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
'
Then modify the fields "cn", "cm", "an", "am" and the content of the two if statements accordingly, copy/paste this script into the shell and press enter twice.
This should solve your problem, but keep in mind that this is not a good practice when you share a repository with others, since it rewrites history.
See also the Troubleshooting information here and the GitHub Help page about changing author info.
On Mac, I had to change the credentials of the old user from the Keychain Access. Documented here

Setting SVN username (Author Name in Eclipse) when using svn+ssh

When I commit changes in Eclipse, svn records my author name as the one that I entered the first time I committed changes in Eclipse (Alok). By author name, I mean the name that shows up when you run "svn log" or "svn blame".
However, when I commit changes from the command line, the Author Name is set to the username that I use to ssh to the repository (svnadmin). Is there a way to set the equivalent of Author Name/svn username independently of the ssh username from the command line when using svn+ssh? I have tried
svn --username Alok ci
but the username in this case is ignored, and the change is attributed to svnadmin.
It is by design that you cannot change the username for svn+ssh. If you could, you would be able to fake somebody else as the committer - when the SSH key would normally clearly identify yourself as the committer.
So if you want different committer names to show up with svn+ssh, you need to change something on the server:
Create separate remote users, and put your key into the authorized_keys file for the user you want to appear as committer. Alternatively,
Put command= lines into the authorized_keys file of the svnadmin user. The command should read /usr/bin/svnserve -t --tunnel-user Alok; optionally also with a --root option.
One workaround is to first enable editing of revision tags by putting a shell script like the following in hooks/pre-revprop-change
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
if [ "$PROPNAME" = "svn:log" ]; then exit 0; fi
if [ "$PROPNAME" = "svn:author" ]; then exit 0; fi
exit 1
Then, after the commit you can change the svn:author with
svn propset --revprop -r1234 svn:author Alok
This does not explain how eclipse is able to set svn:author at commit time without having a pre-revprop-change hook. This solution is a little unsatisfying because it allows any user to change the svn:author of any commit, it would be nice to know what eclipse is actually doing.