I'm relatively new to Git and all of this but as of recently my commits gave gone funky. You might be asking yourself what I'm talking about. Well...
All of my new commits look like this. It appears as though a "non GitHub" person has commited the message.
All I can do is add myself as a co-author. It looks like this.
I've tried reinstalling Git, JetBrains IDEs. No luck. Can anyone please help me. And yes. I'm sort of a newbie. Don't judge me.
You need to make sure you have your global configuration correctly set when making commits:
git config --global user.name misobarisic
git config --global user.email <github_email>
That is: use your GitHub username account (github.com/misobarisic) and GitHub user email.
Then create a new commit and push it, to check the problem is no longer there.
Related
The GitHub profile does not show my commits.
I have figured it out and posted my solution below.
I figured out out. I need to make sure the Gihub registered email is same as my local config email. so just set
git config --global user.email "myemail#xxx.com"
That's it.
Details:
https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/
I'm struggling with an issue connected to GitHub. I've committed some changes using GitBash console and got an info that the push was successful and there's nothing to commit. When I went into logs, there was this particular log looking like this:
The issue is that when I go back into my GitHub account, I can see just an initial commit in there, nothing more.
And the console clearly says that the commit was successful.
Please help!
Git is a distributed version control system, so you have one local copy of the repository, Github has another copy. As far as git is concerned every copy is equally important.
For your changes to exist in Github, you have to push them there, with something like:
git push origin master
Try git remote -v to get more information on your tracked repositories. Github has some great help pages on this stuff.
For what you say in your question, I think you don't have actually pulled your local repository in your GitHub account.
To do that, use git push origin master
When you use git commit your changes are saved in your local repository, not in your remote (that in this case is GitHub)
Thanks to all that helped me understand my issue. Turns out the files did not copy between folders properly and that's why there're not changes detected on git. Now everything is working.
Thanks again!
Coming from a SVN world, wrapping my head around Git has been a little weird, and I'm having trouble letting go of some of the practices ingrained in me from using Subversion for so long. So, for example, in SVN a branching structure might look like this:
-Trunk
--Master
-Branches
--SomeFeatureBranchA
--SomeFeatureBranchB
So, in this situation my Master branch has it's own set of code, and once I check out SomeFeatureBranchA & SomeFeatureBranchB, they'll have their own code. However, when I create a branch in Git, I see my branch listed, but at this point I'm unsure of how to edit the code for that branch.
Do I clone that branch down & simply rename it like:
-Trunk
--Master
--SomeFeatureBranchA
Or is there some command I'm missing that handles this for me?
Thanks for taking your time to help me out!
git branch will tell you which branch you're currently on (as will git status). Just edit as you normally do, if you're on the right branch. If you're on the wrong branch git checkout some branch will get you there. The top of the git repository is the equivalent of subversion /trunk or /branches/SomeFeatureBranchA.
Forget everything you know about SVN when working with Git. You described your problem by comparing it with SVN, which makes it pretty difficult to understand what your problem actually is.
You created a branch in git (either with git branch <name> or git checkout -b <name>) and made it your active branch. Simply start hacking away at the code to edit your branch. When you're done, stage (read "add") and commit your changes, then push them at a later time if you're working with a remote tracking repository.
Does that answer your question? If not, can you please clarify what exactly it is you're trying to do?
I've seen several questions/answers very similar to this but still not sure I understand if they are what I need. So accept my apologies if this was covered before by something similar.
I have a private GitHub account with several repositories. I created these from my mac, pushed them to GitHub and everything works great.
From my Ubuntu desktop, I did a git clone and pulled a couple of the repositories to that desk top. Now from Ubuntu, I make a change to a file, add it, commit it, and push it to GitHub.
Question:
How (what command) on my mac do I use to pull that change down to my local repository so I get that change(s)? UserName is JohnCowan, repo is sacnomadgolf.git
Thanks for the help.
You said you made the repo on your Mac. Then you can just do git pull in the folder you have the repository in.
A really good resource on Git, with explanatory illustrations about the "Git workflow":
http://git-scm.com/doc
I just helped a friend to set up a Github account to collaborate on my project. His commits come through, but for some reason on the "Source" page of my repository next to his commit is only his name and not his username (with a link).
It seems strange, since Github obviously recognizes him (I added him to the list of collaborators etc.
Seems like a stupid question, but Google couldn't help.
Thanks!
Does your friend have the e-mail address he is using for his commits correctly set up as an alias in GitHub? Otherwise, how is GitHub to know who he is? Git itself only records the full name and the e-mail address and obviously not the GitHub username, since you can use Git perfectly fine without GitHub.
Run this in Terminal:
git config --global user.name "your-github-username"
git config --global user.email "your-github-email"
Add the email used in the git commits to github via Account Settings: Email Settings
Just ask your friend to add email that he use in local git commits to his GitHub account emails list as stated in GitHub Help
you can check the GitHub article:
$ git config --global user.name "example"
$ git config --global user.email "email#example.com"