i just not able to add file on github using git bash
error message :
fatal: unable to auto-detect email address (got 'M S#folder.(none)')
i tried this command:
git commit -m "first commit" filename
any help ?
When you installed git in your system first time, you have to set your user name and email. You can set your credentials using the below given command.
$ git config --global user.email "email_id"
$ git config --global user.name "user_name"
Related
I am trying to push my patches to a Gerrit server, I've generated a SSH key and added to the Settings. However, when I'm trying to push(repo upload), it shows another username so I don't have permission to push.
I've tried using git config to set my username but not working at all.
Performed ssh -vv -p 29418 genesis331#gerrit.aospa.co it works but not ssh -vv -p 29418 cheah3838#gerrit.aospa.co.
Btw my email is cheah3838#gmail.com maybe it is an important information?
In the console,
cheah3838#gerrit.aospa.co: Permission denied (publickey).
fatal: Could not read from remote repository.
But actually should be genesis331#gerrit.aospa.co.
You need to configure your Git config for repo upload
$ git config --global review.gerrit.aospa.co.username genesis331
The repo documentation may help you if you need more information:
$ repo help upload
[...]
review.URL.username:
Override the username used to connect to Gerrit Code Review. By default
the local part of the email address is used.
The URL must match the review URL listed in the manifest XML file, or in
the .git/config within the project. For example:
[remote "origin"]
url = git://git.example.com/project.git
review = http://review.example.com/
[review "http://review.example.com/"]
autoupload = true
autocopy = johndoe#company.com,my-team-alias#company.com
[...]
I have a question , I want to push my app on git but when I try to but I received a message "log/development file exceds 100MB".
So I try cmd :
- rake log:clear => Nothing changes
- git rm --cached => Nothing changes
- git filter-branch --index-filter 'git rm --cached --ignore-unmatch log/development.log' --tag-name-filter cat -- --all
- echo log >> .gitignore
-git rm log/development.log
git commit -m "removed log file"
But when I do git status then git add . then git commit -m then push I still have this error message , so I check my log/development file and is empty
My question is why git still display this error message??
Please Heeeeeelp
Thank you
You don't need push log file that's why you need to ignore this file for git push like below
If you initialize repsitory then automatically added a file which name .gitignore like
$ git init
$ git add .
$ git commit -m "Initialize repo"
#=> if you not added before
$ git remote add origin git#github.com:User/UserRepo.git #=> example user
$ git push
That's it, but in case if .gitignore file setup missing something then you can get it manually like below
#=> project/.gitignore
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
Hope to help.
The best I could do is remove the file from the repo's history:
bfg --delete-files development.log
Hopefully that's useful to you.
Warning: Extremely destructive.
Whenever I try to commit, using source control in Xcode, I get an error that I need to configure my email address and name (it seems to read my email address incorrectly). I went to the Terminal, and entered them (again). The error didn't go away.
I can commit normally in Terminal, but not in Xcode. Is there a way to fix it? Or enter the configuration info directly in Xcode?
This is the error message:
*** 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
'myemail#gmail-1040826.(none)')
Here's my .gitconfig (I replaced my actual name with "My Name", and my username with "myname" for privacy reasons):
myname-1040826:Project myname$ git config -l
user.email=myname#gmail.com
user.name=My Name
filter.media.clean=git-media-clean %f
filter.media.smudge=git-media-smudge %f
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
submodule.PeerKit.url=https://github.com/jpsim/PeerKit.git
It looks like Xcode is not reading global GIT settings. If you encounter this issue, set your name and email to the specific project via the Terminal:
git config user.email "you#example.com"
git config user.name "Your Name"
Note: Make sure you are in the project's directory when you do the above.
It's not only the matter in global settings, the real problem are local ones.
Try this.
cd your/project/directory
git config --local user.email "your#email.com"
git config --local user.name "yourName"
This worked for me.
Problem 1.
when I run the command
$ git config --global user.name
# or
$ git config --global user.email
I get the following error message:
error: More than one value for the key user.name/email
So it seems like I have multiple values stored against both my user name and email. I want to have one value stored in each.
Problem 2.
The name shown against my commits on github is not linked to my account. means not hyper linked its blocked.
I searched a lot but got no satisfactory result to my problems. anyone can please help.
Solution to Problem 1:
First look to see what is listed in the config:
git config --list
Example output:
enter code here
user.email=abarker#cern.ch
user.name=fiveisgreen
user.github=fiveisgreen
user.name=Anthony
In this example, user.name is listed twice. To remove the duplicate do:
git config --global --unset user.name Anthony
Have a look in ~/.gitconfig
I'm guessing yours should look something like this:
...
[user]
name = Sami
email = xxx#xx.com
name = Sami
email = xxx#xxx.com
....
Just remove the dupliucate entries to get rid of the message.
In terms of linking to github, check out this answer
git config -l #shows you what name, email and other stuff is saved
cat ~/.gitconfig #shows you samething(what's saved in your /home/username/.gitconfig)
To change stuff on existing commits in your machine you can try this on the commandline:
$ git config user.name "Your Name"
$ git config user.email "your#address.com"
$ git submodule foreach --recursive 'git config user.name "Your Name" && git config user.email "your#address.com"'
.... see rest here : https://gist.github.com/carlosmcevilly/2221249
ps:if you have already commited stuff and want snyc with github, then ask another question(that is separate issue)
Are you using Windows or a Unix based system? If you are on a Unix based system you can check the config inside the config file. Go to your home folder and in there, there should be a hidden file called .gitconfig open it and see what info you have there. Maybe there is an error on the file.
I'm new to rails and git. I have a rails application under ..../myapp that I would like to deploy using capistrano. I followed the steps described in "Agile Web Development with Rails". To put the application under version control, I did the following:
1) Put my application under version control:
$ cd myapp
$ git init
$ git add .
$ git commit "..."
That all went fine, it created a .git directory under myapp/
2) Created an empty repository on the server:
$ mkdir -p ~/git/myapp.git
$ cd ~/git/myapp.git
$ git --bare init
$ Initialized empty Git repository in /root/git/myapp.git/
3) Created a public key
$ ssh-keygen -t rsa -C "myemail#myemail.com"
$ Your identification has been saved in /root/.ssh/id_rsa.
$ Your public key has been saved in /root/.ssh/id_rsa.pub.
$ The key fingerprint is:
$ d2:16:76:e0:4c:71:de:de:4b:d3:16:94:cc:d7:65:11 myemail#myemail.com
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
4) From my application directory: created the path to the server and push the code
$ git remote add origin ssh://me#host/~/git/myapp.git
$ git push origin master
Now I'm being asked to enter my password, after that:
$ fatal: '~/git/myapp.git' does not appear to be a git repository
$ fatal: The remote end hung up unexpectedly
It might be worth noting that this all happens on the same server, a RHEL 5.7. This is something that confuses me because I basically ssh from my server onto my server. But apparently that's how capistrano does it, even if the application_development and the svn repository are on the same physical machine.
# manojlds:
$ GIT_TRACE=2 git push origin master
$ trace: built-in: git 'push' 'origin' 'master'
trace: run_command: 'ssh' 'me#host' 'git-receive-pack '\''/root/git/myapp.git'\'''
Pretty sure you don't want the tilde ~ in the path. I'd put the actual path in (eg /home/users/)
It is possible that using a relative path and specifying the ssh portion is causing it to break when adding origin.
Try something closer to this:
git remote add origin user#myserver.com:/var/git/myapp.git