How to find Github Repository's committees and their commit counts - github

I have gone through github documentation and not able to find how to get Github Repository's committees and their commit counts. Does anybody have idea about the same ?

You should go to check GitHub Developer API
https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts

Go to specific branch and fire follow command :
git shortlog -s -n
git shortlog -s
git shortlog -n
git shortlog
Hope this will help you.

Related

delete branch and messed up backup..need to recover or jump off bridge [duplicate]

I just deleted the wrong branch with some experimental changes I need with git branch -D branchName.
How do I recover the branch?
You can use git reflog to find the SHA1 of the last commit of the branch. From that point, you can recreate a branch using
git branch branchName <sha1>
Edit: As #seagullJS says, the branch -D command tells you the sha1, so if you haven't closed the terminal yet it becomes real easy. For example this deletes and then immediately restores a branch named master2:
user#MY-PC /C/MyRepo (master)
$ git branch -D master2
Deleted branch master2 (was 130d7ba). <-- This is the SHA1 we need to restore it!
user#MY-PC /C/MyRepo (master)
$ git branch master2 130d7ba
If you know the last SHA1 of the branch, you can try
git branch branchName <SHA1>
You can find the SHA1 using git reflog, described in the solution --defect link--.
If you just deleted the branch, you will see something like this in your terminal:
Deleted branch branch_name(was e562d13)
where e562d13 is a unique ID (a.k.a. the "SHA" or "hash"), with this you can restore the deleted branch.
To restore the branch, use:
git checkout -b <branch_name> <sha>
for example:
git checkout -b branch_name e562d13
If you haven't push the deletion yet, you can simply do :
$ git checkout deletedBranchName
Follow these Steps:
1: Enter:
git reflog show
This will display all the Commit history, you need to select the sha-1 that has the last commit that you want to get back
2: create a branch name with the Sha-1 ID you selected eg: 8c87714
git branch your-branch-name 8c87714
First: back up your entire directory, including the .git directory.
Second: You can use git fsck --lost-found to obtain the ID of the lost commits.
Third: rebase or merge onto the lost commit.
Fourth: Always think twice before using -D or --force with git :)
You could also read this good discussion of how to recover from this kind of error.
EDIT: By the way, don't run git gc (or allow it to run by itself - i.e. don't run git fetch or anything similar) or you may lose your commits for ever.
If you deleted a branch via Source Tree, you could easily find the SHA1 of the deleted branch by going to View -> Show Command History.
It should have the next format:
Deleting branch ...
...
Deleted branch %NAME% (was %SHA1%)
...
Then just follow the original answer.
git branch branchName <sha1>
Thanks, this worked.
git branch new_branch_name sha1
git checkout new_branch_name
//can see my old checked in files in my old branch
This worked for me:
git fsck --full --no-reflogs --unreachable --lost-found
git show d6e883ff45be514397dcb641c5a914f40b938c86
git branch helpme 15e521b0f716269718bb4e4edc81442a6c11c139
if you deleted a branch using GUI of a Jetbrains IDE(Goland, phpstorm etc)
go to
git windows(left-down corner of IDE) -> console tab -> now you can see log of executed commands by IDE and find the branch name and SHA1 from this log
If you are using IntelliJ IDEA, in Event Log you'll see something like that:
And may simply restore your branch.
First of all, don't get panic. You are in the right place.
Go on champ, we all make mistakes! That's how we learn!
I wish you health, happiness and success!
Oh for the answer! I think you already figured out!
If not! here is the answer.
use git reflog
git checkout branch branch_name commitsha
For more clarification, in the second command branch_name is the name you want to give your branch. commitsha is sha number you want to check out. which you will get from git reflog command.
Once again Happy coding!

GitBash cmd line branch delete

what does it mean that I see (feature/StoreTextVariable_134) (I assume branch I created earlier in and switched to in VS, and I deleted the local code earlier)?
how can I get rid of it?
I'm a GitBash newbie.
what does it mean that I see (feature/StoreTextVariable_134)
feature/StoreTextVariable_134 is the branch of git that you are currently working on.
Type git branch to check how many branches in your source code.
how can I get rid of it?
Use git checkout to move to the branch you need to work with.
output
Note: If there is a change in source code on the current branch then you need to commit before switching branches.
Please refer more detail here:
Git document
Thanks #Tai I had to use -f with my checkout so that I could discard pending changes I didn't need
git checkout -f branchName
then to delete it I used
git branch -d -f branchName
now I am back on my default branch

Check and download difference.

I want check github repo and if is difference - download it.
How I can make it?
I will write bash script for it, but I can not find information about repo difference.
If you have a local repo linked to a GitHub remote repo which might have evolved, you can download and compare the difference with:
cd /path/to/local/repo
git fetch
git diff master origin/master

Forking Rails Tutorial sample_app for Rails 4

I'm trying to fork Michael Hartl's sample_app_rails_4 (https://github.com/railstutorial/sample_app_rails_4). I keep getting the error message:
'fatal: Could not read from remote repository.Please make sure you
have the correct access rights and the repository exists'
after entering the following commands.
$ cd /tmp
$ git clone git#github.com:railstutorial/sample_app_rails_4.git
I appreciate any help in getting this (seemingly simple) step to work.
It looks like SSH is not an option on that repository. Try
git clone https://github.com/railstutorial/sample_app_rails_4.git
Not actually forking, but that worked for me.
You need to fork the repo, get it in your personal GitHub repository, and then clone the version that is in your personal repo. Here is a GitHub article on forking and cloning: https://help.github.com/articles/fork-a-repo
Here are the steps at a high level:
Go to Hartl's repo and click fork. This will copy the project in your GitHub account.
Clone the repo from your personal account:
$ git clone git#github.com:your_github_usernamesample_app_rails_4.git

Gollum wiki github - Your branch is ahead of 'origin/master' by 1 commit

I have problems using Gollum wiki with github remote wiki pages.
I created a wiki for this project, and Create Wiki pages in wiki git repo.
Clone the repo using ssh:
$ git clone git#github.com:ricardogarfe/python-sample-test.wiki.git
Install Gollum:
$ sudo gem install gollum
Run gollum inside wiki repository:
$ cd python-sample-test.wiki.git
$ gollum
Edit home page and save with comments.
Then I ran:
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# nothing to commit (working directory clean)
So I can't do push to origin when I edit wiki pages using gollum.
I forget any configuration ? user, groups in linux to make commits, push automaticaly through gollum ?
Using:
ruby 1.8.7
gem 1.8.15
Thanks!
Ricardo.
I haven't worked with gollum so this may be a bit off base, but your output indicates that there is a commit which hasn't been pushed yet:
# Your branch is ahead of 'origin/master' by 1 commit.
If you look at the output of git log -p -1 does it appear to contain the changes you made? If so, just git push and you should be set.