Response
stringlengths 8
2k
| Instruction
stringlengths 18
2k
| Prompt
stringlengths 14
160
|
---|---|---|
14
I just come across this issue right now, it is caused by permissions, please make sure that you current account has the permissions of git pull and git push,in your case , maybe you create a private repository in Github, and not add this account as Manage Collaborators, then the issue come.
Certainly you also should check if the remote URL is completely correct, include case insensitive, https or http.
Share
Improve this answer
Follow
edited Apr 28, 2013 at 8:54
nhahtdh
56.4k1515 gold badges127127 silver badges163163 bronze badges
answered Apr 28, 2013 at 8:45
shanegaoshanegao
3,57211 gold badge1818 silver badges2222 bronze badges
Add a comment
|
|
I'm trying to clone an existing github-repository (Git for Windows) to an empty folder using
git clone https://github.com/di98jgu/D0016E---Digitalt-projekt.git
but keep getting the error message:
fatal: https://github.com/di98jgu/D0016E---Digitalt-projekt.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
The server is working fine (others are using it). Have tried adding the paths of git-upload-pack and git-receive-pack to gitconfig,
[remote "origin"]
url = https://github.com/di98jgu/D0016E--Digital-projekt.git
fetch = +refs/heads/*:refs/remotes/origin/*
uploadpack = libexec/git-core/git-upload-pack
receivepack = libexec/git-core/git-receive-pack
but it didn't help. Seems like a lot of people are having problems causing a similar, but not exactly the same, error message git-upload-pack command not found, but don't think these solutions apply to my situation.
Anyone know how to solve this?
|
git-upload-pack not found
|
Set up a .mailmap file in your repo. See git help shortlog for details, or check out the one for Git itself.
See Mapping authors section: https://git-scm.com/docs/git-shortlog#_mapping_authors
|
So I've managed to commit to a GitHub project as both domenic <[email protected]> and Domenic Denicola <[email protected]>. This is annoying, especially for generating summaries.
I know about how to change the authors/committers retroactively. However, this has lots of undesirable consequences for a project that is already pushed and public, e.g. changing all the hashes (and thus invalidating links to them people have made, or comments on them); losing the tags; and I'm afraid GitHub might even end up appending "committed 5 minutes ago by Domenic Denicola" to every single commit in the project. So that's not an option.
I was hoping there was some way to tell Git, "these two authors/committers are exactly the same person; count them as such." Is there?
|
"Alias" git authors/committers?
|
According to graphql documentation there are more than one pagination model.
GitHub is using complete connection model
In this model you can traverse with adding after:"Y3Vyc29yOjEwMA==" to your search query.
query {
search(first: 100, after:"Y3Vyc29yOjEwMA==", type:USER, query:"location:usa repos:>0 language:java") {
pageInfo {
startCursor
hasNextPage
endCursor
}
userCount
nodes {
... on User {
bio
company
email
id
isBountyHunter
isCampusExpert
isDeveloperProgramMember
isEmployee
isHireable
isSiteAdmin
isViewer
location
login
name
url
websiteUrl
}
}
}
}
|
I'm using Github API v4 to run search query.
From the API documentation I can understand that the following query gives me pageInfo but I don't know how to use it to traverse.
query {
search(first: 100, type:USER, query:"location:usa repos:>0 language:java") {
pageInfo {
startCursor
hasNextPage
endCursor
}
userCount
nodes {
... on User {
bio
company
email
id
isBountyHunter
isCampusExpert
isDeveloperProgramMember
isEmployee
isHireable
isSiteAdmin
isViewer
location
login
name
url
websiteUrl
}
}
}
}
And response is:
{
"data": {
"search": {
"pageInfo": {
"startCursor": "Y3Vyc29yOjE=",
"hasNextPage": true,
"endCursor": "Y3Vyc29yOjEwMA=="
},
...
}
|
GitHub API v4: How can I traverse with pagination? (GraphQL)
|
You can click on the Insights tab (next to Issues and Pull requests) and you will see a sidebar on the left.
Then click on Network. You will see the most active forks there.
For example:
https://github.com/cyverse/clank/network
|
There is a certain repository that has been forked by many tens of users. However most of them are inactive. The ones that are still active will probably have n commits ahead of master. However when I click on fork I can see all the users that forked but I cannot select the ones that are active.
Is there a way to see who's active or who has commits ahead of master?
|
Github, forked repositories ahead of master: active users
|
No, they will not be gc's because they're not wholly unreferenced even if you delete your branch.
Github creates a branch (actually, two) for every pull request. They're in a non-default namespace so you dont usually get them when you pull (or fetch) from the repo.
To see how this looks in practice, do a git ls-remote <REMOTE>, where <REMOTE> is either the name of a remote (if it's one your repo knows) or the URL (it doesn't need to be git remote added for this to work). This remote should have some pull requests, or you won't be able to see what I mean.
This will list all refs on the remote (all branches and tags), and you will see some refs like refs/pull/<number>/head and refs/pull/<number>/merge. Those refer to the latest commit in the PR and the commit at which it was merged in, respectively.
|
The following situation arises from time to time…
I git checkout -b experiment, commit some experimental changes, and open a pull request. After some discussion, the pull request is rejected.
If I were now to delete the remote branch, would this render the diff inaccessible at some point, or does GitHub ensure that commits which appear in pull requests are not garbage collected even if they don't appear on any branch?
I would like to delete dead branches, but only if doing so will not diminish the historical value of rejected pull requests.
|
Does GitHub garbage collect dangling commits referenced in pull requests?
|
In your case, I would suggest going with submodules. However to answer your exact question, here's how you should proceed.
Start by creating Jeremy/MyShooter and Jeremy/MyRPG on Github. Keep them empty.
Clone your origin project on your system, twice, giving it different names
$ git clone http://github.com/Bob/CoolFramework MyShooter
$ git clone http://github.com/Bob/CoolFramework MyRPG
You now have 2 different local repos pointing to the same origin. You should remove the origin and point to yours as a remote:
$ cd MyShooter
$ git remote remove origin
$ git remote add origin http://github.com/Jeremy/MyShooter.git
$ git push -u origin master
Don't forget to do the same for MyRPG
|
On GitHub, I can't seem to figure out how I can fork a repo twice into one account.
So there is a repo from Bob/CoolFramework
I fork it to Jeremy/MyShooter and start to build a game
Now I also want to fork it to Jeremy/MyRPG to build another new game
When I try to fork CoolFramework a second time, it just takes me to MyShooter.
So the options I can think of:
A) I'm not using Git in the right way
B) It's not possible on Git
C) I just couldn't see the option on Github
|
Can I fork another persons repo twice into my own account?
|
Update Nov. 2020: you now have "Custom notification controls"
This week we are giving you more control over the types of content that you are notified about on GitHub:
Watching a repository can often be a double-edged sword.
You want to stay up to date with a project, but if you have a specific interest or role within the community, you have no choice but to subscribe to updates on everything.
No more.
Beneath the watch button, you’ll find that we have made a few changes: we’ve made the language clearer so you know what you’ll receive updates about, we’ve made the interface more accessible and, we’ve introduced a new custom category.
Within this, you can select the types of content you would like to be notified about.
Do you focus on code review? Limit your notifications to pull requests.
Are you a community manager? Select Discussions.
As new types of notifications are added, you’ll find them in this menu.
You’ll find these controls on all repository pages and on your watching page where you can customize notifications for repositories you already watch.
Update May 2019: you now have "Custom thread subscriptions"
You can now limit the types of notifications you receive for any issue and pull request to be specific to merge, reopened and/or closed events.
That should allow to further control the amount of emails received.
Update July 2017: you now can declare in the GitHub repo a code owner.
Any pull request touching a file managed by said code owner will trigger a notification to that person.
See "Repo owner automatic notification after updating a pull request"
2015: Yes, for instance, for a specific issue on a project (issue 2595), you can register by clicking the "Subscribe" button at the right side of the page (since 2015).
Once clicked, it will appear as "Unsubscribe" (for you to click if you don't want any more notifications)
So you don't have to watch the all repo, you can subscribe only to specific issues.
|
Github provides notifications via mail or web, based on watched repos. But is there a way to get more in detail? Like only watch a specific pull requet or assigned issue? I feel like i get spammed from comments on other pull requests that have nothing to do with me.
|
How to get specific github notifications like pull requests or assigned issues?
|
First of all, note that Gist doesn't support directories. To import a repository into a gist follow the next steps:
Create a new gist and clone it locally (replace the dummy id with your Gist id):
git clone [email protected]:792bxxxxxxxxxxxxxxx9.git
cd to that gist directory
Pull and merge from your GitHub repository:
git pull [email protected]:<user>/<repo>.git
Push your changes
git push
Again, note that if you have directories, you have to delete and commit them:
rm -rf some-directory
git commit -m 'Removed some-directory' .
Using the steps above, the project history will be kept. If you don't care about history, you can always push files in your Gist. Let's say you have a repository containing multiple folders and you want for each folder to create a Gist. You will repeat the next steps (or a script could do that):
git clone [email protected]:<gist-id>.git
cd <gist-id>
cp ../path/to/your/github/repository/and/some/folder/* .
git add .
git commit -m 'Added the Gist files' .
git push
Gist is different than how GitHub works:
Gist is a simple way to share snippets and pastes with others. All gists are Git repositories, so they are automatically versioned, forkable and usable from Git.
However, if you try to push directories in Gists you will get errors from remote:
$ git push
Counting objects: 32, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (32/32), 7.35 KiB | 0 bytes/s, done.
Total 32 (delta 10), reused 0 (delta 0)
remote: Gist does not support directories.
remote: These are the directories that are causing problems:
remote: foo
To [email protected]:792.....0b79.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:79.......9.git'
|
What I would like to do is the inverse of this question. I have a folder within a GitHub repo that contains a d3 visualization that I would like to continue making changes to. It would be nice to have a "gist" version of this repo to display the visualization on bl.ocks.org that I could push changes to when from the primary repo after I am happy with them.
Another similar question is here, but the answers describe the step gist -> bl.ocks.org. I am unsure of the step githup repo -> gist. What is the best way to accomplish this?
|
How to convert files in GitHub repository to a Gist
|
No one has clearly mentioned this, but the github raw urls expire in 7 days.
You can use longer lasting personal access tokens generated here: https://github.com/settings/tokens but those can only be used via curl:
curl -H 'Authorization: token <personal_token>' <raw_url>
Note that the personal access tokens expire if unused for an entire year.
|
Do GitHub raw urls for private repositories expire? I'm referring to the link generated when you click the Raw button while viewing a file on github.com.
The link includes a token but there's no info about where that token comes from.
|
Do GitHub raw urls expire?
|
23
It is not possible to sort by stars when searching inside code.
From an e-mail from github.com support:
Code search does not support sorting by number of stars, but I will definitely add your +1 to that suggestion internally! I can't say if or when a change will happen, but your feedback is in the right hands.
You may want to vote for this feature: Add Stars count filter.
The feedback is related to this announcement: Improving GitHub code search
Share
Improve this answer
Follow
edited Dec 9, 2021 at 14:11
answered Jun 26, 2018 at 7:05
Andrei Damian-FeketeAndrei Damian-Fekete
1,9302222 silver badges2727 bronze badges
1
3
that is a shame. Not only one, but two reasons: a) it is basic functional requirement to sort hundreds of result by some quality rank. b) As for any result item, there is a single star number attribute, and it is simple to get, there is no technical difficulty to do this.
– g.pickardou
May 4, 2022 at 5:05
Add a comment
|
|
I'm not sure if this is the right forum for this question. Saw quite a few Q&A related to search on GitHub, hence posting here.
E.g. Search code inside a Github project
GitHub advanced search allows terms like stars:>100 but the query term is restricted to repository names only. Is it possible to search for a term inside the files (code) & sort by stars? My aim is to see which popular repos are using a particular keyword in their code. It would be very useful if GitHub's advanced search options for Repositories worked for Code also.
|
GitHub : Is it possible to search inside code and sort by stars
|
The issue is that the GitHub plugin only accepts plain text credentials.
The GitHub access token can be created manually, or automatically via the Advanced... options as described here.
In case you already have an access token in GitHub (you'll get an error in Jenkins), you can remove it in Github. Then you can let Jenkins generate the token and select it in the Credentials menu.
|
I got very strange behavior that has never happened before, when I try to configure the GitHub server in Jenkins general configuration to set up webhooks auto.
The drop down menu doesn't display my registered credentials. I was always be able to do that, but suddenly I don't know what's happening. I tried to uninstall the plugin, restarting Jenkins, kill the Jenkins Docker container and configure all the stuff again ... still I got the same issue.
There is no other option other than none, and when I add new credentials I still get None as the only option...
|
Jenkins GitHub plugin can't choose my credentials
|
GitHub keeps track of forks made through their interface and assumes pull requests will be for that original repository. You need to tell GitHub that your copy is not a fork but rather a regular repository that just happens to have identical history. Sadly, GitHub doesn't offer a good way to just uncheck the fork link. I typically solve it this way:
Clone the repository, git pull, and ensure your local copy is completely up to date.
Delete the repository on GitHub.
Create the repository on GitHub using the exact same name. Ensure it's an empty repository (don't create a README or LICENSE file.)
git push all the content back into the repository. (You may need to switch to each branch and push it, and you also may need to git push --tags.)
FRAGILE: This approach will lose existing GitHub issues and pull request comments. If you're using these heavily, this approach is probably a bad idea, and you should contact GitHub customer support to help you instead.
|
I have a set of documentation for my company's API, based on the excellent Slate framework from TripIt. Per instructions, I forked their repo and proceeded to customize it. That fork lives here.
The obnoxious thing is that when contributors in my organization do a new pull request, the "base fork" on the Github "Comparing Changes" screen defaults to TripIt's repository, not my fork. They've more than once sent pull requests to the wrong place. Telling people "don't do that" isn't a particularly reliable solution. How can I set the default for where PRs are based to my fork?
|
How to set default fork for pull requests?
|
15
The old post you refer to is "Syntax Highlighted Diffs", Dec. 2014
However, nothing in the current GFM (GitHub Flavored Markdown) suggests this particular combination (of diff and syntax highlighting) is currently supported.
Share
Improve this answer
Follow
edited Oct 23, 2023 at 22:08
Benjamin Loison
4,15444 gold badges1818 silver badges3535 bronze badges
answered Dec 31, 2016 at 9:32
VonCVonC
1.3m539539 gold badges4.6k4.6k silver badges5.4k5.4k bronze badges
2
Has anything changed since you posted your answer in 2016?
– Shimmy Weitzhandler
Apr 11, 2023 at 4:25
2
@ShimmyWeitzhandler Not that I know of, and the 2022 discussion on this does not leave much room for hopes.
– VonC
Apr 11, 2023 at 6:01
Add a comment
|
|
I've just seen this (old) post, and I was wondering if we could the same thing using GitHub flavoured markdown: Combine the normal syntax highlighting with the diff one.
I tried a few things, like
```python&diff
- import that
+ import this
```
```python
- import that
+ import this
```
```pythondiff
- import that
+ import this
```
```diffpython
- import that
+ import this
```
But none of them worked... So, do any of you know how to do this? Or it's not possible?
|
Syntax Highlighting Combine diff and xxx
|
You need to put workflow_dispatch: under on:.
name: Test
on:
release:
types: [created]
workflow_dispatch: # Put here!!
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
Then, a Run workflow button is shown.
It's ok to put workflow_dispatch: before release:. It works as well.
name: Test
on:
workflow_dispatch: # Putting here is also fine!!
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
|
I created the workflow Test but there is no Run workflow button to run it manually.
This is my test.yml file. Is there anything missing?
name: Test
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
|
Workflow is not shown so I cannot run it manually (Github Actions)
|
Step 1: Unset existing credentials
Copy this into your terminal:
git config --global --unset credential.helper
git credential-osxkeychain erase
host=github.com
protocol=https
and hit 'Enter' twice to delete existing GitHub credentials (username and password) from your computer.
Recommended: if you were previously authenticating using a GitHub Personal Access Token (PAT) and want to update to a new one, invalidate any old one(s) by visiting https://github.com/settings/tokens and clicking 'Delete' or 'Revoke All' to ensure an old token can no longer be used.
Step 2
Generate a new access token: go to GitHub, click on your profile pic on the top right -> Settings -> Developer Settings -> Personal Access Tokens -> Tokens (classic) and create a new one (tip: if you're not sure what permissions to grant, just select full 'repos' permissions and nothing more - you can always create another token with more permissions later if required).
Step 3
Go into private repository and try to push/pull. GitHub will prompt you for your username (email or GitHub username) and password (the token you just generated).
|
After creating a personal access token, how do you unset any existing authentication and use the token in the macOS terminal?
I tried running osxkeychain command git config --global credential.helper osxkeychain but it doesn't change anything. I also tried unsetting the user password with git config --global --unset user.password, and I tried opening Keychain Access application and delete GitHub entries, but neither worked.
|
Authentication to GitHub using personal access token on macOS?
|
48
The only answer here didn't work for me, but I found a solution that did.
My offending file was android/java_pid2325.hprof, but yours obviously may vary. I used git filter-branch:
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch android/java_pid2325.hprof'
Make sure to add *.hprof to your .gitignore and push the commit.
Note*-> Make sure to change the name of *.hprof to the same as your local *.hprof
Share
Improve this answer
Follow
edited Apr 17, 2021 at 2:30
answered Sep 27, 2020 at 2:27
David BiggsDavid Biggs
58744 silver badges44 bronze badges
4
Thrilled to help! @RizwanIjaz
– David Biggs
Jan 17, 2021 at 20:59
3
Thank you so much, its the best answer worked for me.
– sanjeev shetty
Jan 21, 2021 at 19:31
please how to add *.hprof to .gitignore ? I have 4 hprof files, do I add them all to gitignore ?
– zedArt
May 20, 2021 at 12:05
@zedArt solution courtesy of Hyeomin Go to ".gitignore" Just put this snippet. *.hprof Save .gitignore file.
– David Biggs
May 22, 2021 at 6:42
Add a comment
|
|
I would like to push my project into the github, however i just notice there is a file called java_pid14920.hprof inside the android folder and cause around 300MB
remote: error: File android/java_pid14920.hprof is 301.75 MB; this exceeds GitHub's file size limit of 100.00 MB
I wonder it is safe to delete this file ?
|
react-native: File android/java_pid14920.hprof is 311.59 MB; this exceeds GitHub's file size limit
|
Even though they are called exactly the same thing, a GitHub pull request and a 'git request-pull' are completely different.
The git request-pull is for generating a summary of pending changes to be sent to a mailing list. It has no integration by default with GitHub.
The GitHub Pull Requests is a fully featured function of GitHub only. It allows for merging and integration of code from a different branch/fork. You can resolve merge conflicts, do code reviews, or add additional comments to a GitHub pull request.
Unfortunately the git command is named similarly to GitHub functionality which makes it sound like they should be doing the same thing.
|
I've cloned a project, and pushed a branch with just a renamed readme file to README. I am trying to create a pull-request on the command line, just to try PR from here instead of a website.
$ git request-pull origin/master origin readme:readme
The following changes since commit 51320a3a42f82ba83cd7919d24ac4aa5c4c99ac6:
first commit message
are available in the git repository at:
[email protected]:example/com:example.git readme
for you to fetch changes up to 891c05c5236341bcbe33ceddc415ae921ee42e44:
second commit message
----------------------------------------------------------------
Simone Gentili (1):
Fix
readme.md => README.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename readme.md => README.md (100%)
github shows no pull request and I don't see errors.
is possibile to create a pull request directly from bash?
is PR correct and can I view pull request list?
|
git request-pull: how to create a (github) pull request on the command line?
|
It depends on your definition of "last".
for a given branch (like master), GET /repos/:owner/:repo/commits/master is indeed the last (most recent) commit.
But you can also consider the last push event: that would represent the last and most recent commit done (on any branch), pushed by a user to this repo.
|
Which is the best way to get the latest commit information from a git repository using GitHub API (Rest API v3).
Option 1: GET /repos/:owner/:repo/commits/master
Can I assume that the object 'commit' of the response is the latest commit from branch master?
Option 2: GET /repos/:owner/:repo/git/commits/5a2ff
Or make two calls, one to get the sha by getting the HEAD ref from master and then get the commit information using the sha returned.
|
How can I get last commit from GitHub API
|
First, you should always make your PR form a branch, not from master.
master is for mirroring upstream/master, with 'upstream' being the name of the original repository that you forked.
In your case, make sure that:
make sure that upstream exists (git remote -v),
make a branch in order to reference your current patches, and
reset master to upstream/master:
Before:
z--z (upstream/master, with new commits)
/
z--y--y--y (master with local patches, origin/master)
Memorize current work:
git checkout master
git checkout -b mybranch
# Or, With git 2.23+
git switch -c myBranch master
# if remote "upstream" does not yet exist
git remote add upstream /url/original/repo
git fetch upstream
# reset master to upstream/master
git checkout master
git reset --hard upstream/master
git push --force
y--y--y (mybranch)
/
z--z--z (master, upstream/master, origin/master)
# replay the patches (even they are rejected for now) on top of master
git switch mybranch
git rebase master
git push -u origin mybranch
y'--y'--y' (mybranch, origin/mybranch)
/
z--z--z (master, upstream/master, origin/master)
Here: master0 will reset master1 HEAD on the updated master2, in order for master to reflect the exact same history as the one in the original repository.
But since some commits where previously done on master3 and pushed on the fork (master4), you would need to replace that history with the new master5 state. Hence the master6.
Rebasing master7 allows for those current patches to be based on the most up-to-date commit of the original repository.
|
I forked a project on github, in order to send pull requests. The problem is that my way to do was very ... dirty.
I worked on a local copy of the fork, created a branch for my modifications and merge it on the master. Then I pushed the master on the github fork in order to create a pull request.
The problem is that recently, my pull request have been rejected. So now I am 5 commits ahead from the original master. What are the solutions in order to be even with the original repository?
Should I have to checkout the upstream master in a new-branch and make the new master with it (how to do this?)
Or is it better to delete my github fork (I have previous accepted commits) and recreate it (you can see the github repos here)https://github.com/cedlemo/ruby-gnome2
|
github fork : your branch is 5 commits ahead how to clean this without pushing
|
Just use git stash pop or git stash apply. As long as the stashed changes do not conflict with what you pulled or edited, it will just work, if not you get some merge conflicts that you can resolve like when you do a merge or rebase.
|
Yesterday I made some changes on the master branch but didn't commit them, today I tried to pull the master but it said I have to commit or stash my changes Please, commit your changes or stash them before you can merge.
I stashed them git stash and then pulled from master git pull now I have done some changes in my code but figured out that should have done the stash and i had to commit the changes. Now what can I do to have
1) the changes from stash back
2) what I got from git pull
3) and my current changes
I found this post here but the person hadn't pulled from master, so I am not sure the answers there would work for me and cannot really risk it and try as it is on master.
|
how to get the stash back after pulling
|
$ git ls-remote https://github.com/gturri/dokuJClient.git
2fb540fc8c7e9116791638393370a2fa0f079737 HEAD
2fb540fc8c7e9116791638393370a2fa0f079737 refs/heads/master
This command can be run from any directory.
If you only want the last sha1, eg to use it in a script, you could then do:
git ls-remote https://github.com/gturri/dokuJClient.git HEAD | awk '{ print $1}'
|
I want to get the hash of last commit that has happened in a remote repo without cloning it. Is there a way to do this ? I found several methods but for all of them to work, I need to clone the repo first and then issue the commands to get the last commit hash.
Is there a way I can get the last commit hash from a remote git without cloning it ?
Note:
|
Getting the last commit hash from a remote repo without cloning
|
Just pick the hash you want to go back to and in your clone do:
git reset --hard hash#
git push -f origin branch
where branch is the name of the branch you want to push. Voilà. Be carefully with the force push. You may want to copy your working directory until you are familiar with it.
|
Is there anyway for me to delete my github commit history? I don't want to lose all my commits, just the last 10 or so that were pushed to github. I can't seem to figure out how to do this.
|
Delete Github commit history
|
You can configure composer to use key files to access private repository.
More info: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md#security
|
My compsoser.json uses 2 private repositories from our Organisation Github Account and is as follows.
{
"name": "API",
"repositories": [
{
"type": "vcs",
"url": "[email protected]/company/private.git"
},
{
"type": "vcs",
"url": "[email protected]/company/private2.git"
}
],
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": ">2.1.3",
"doctrine/mongodb-odm": "dev-master",
"doctrine/doctrine-mongo-odm-module": "dev-master",
"company/private": "dev-master",
"company/private2": "dev-master"
}
}
We've setup SSH keys and added them to the authorized keys on our staging server. When we run git clone it works perfectly and isn't asking for any credentials.
However, when we run composer update the fetching of the repositories fails because composer doesn't have access to the repositories.
Since this is ran in a non-interactive way as this is part of a build script we can't enter credentials and like to have this automated.
What can we do to let composer have access to our private repo's during the build?
|
Using Composer and Private Repository on GitHub using VCS on Build Server
|
This will throw away all local changes in the working tree and the four latest commits:
git reset --hard HEAD~4
|
This question already has answers here:
How do I undo the most recent local commits in Git?
(106 answers)
Closed 10 years ago.
I have run git status and
# On branch master
# Your branch is ahead of 'origin/master' by 4 commits.
# (use "git push" to publish your local commits)
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: app/views/layouts/_header.html.erb
#
no changes added to commit (use "git add" and/or "git commit -a")
I want undo all the 4 commits and changes not staged for commit before commiting to my remote repository. How can i do this?
|
Undo several commits in git which have not pushed to remote [duplicate]
|
Well the solution was pretty simple, hinted by Pat Notz and Bombe.
#Make sure we're on the master branch
$ git checkout master
# Make a new branch to hold the work I've done
$ git branch old_master
# Save this branch on my remote repo (for backup)
$ git checkout old_master
$ git push origin old_master
# Reset my local master back to match the commit just before I started
# working on my new feature
$ git checkout master
$ git reset --hard 2aa93842342342
# Get it to be the same as my Central
$ git pull upstream master
# Now DELETE my master on my remote repo
$ git push origin :master
# And recreate it
$ git push origin master
# Branch created!
#* [new branch] master -> master
#
Now I have two nice branches: master and old_master. With master being a copy of my Central, for fixes to production, and old_master holding all the work that I did previously!
Thanks!
|
I recently screwed up my git repo and would like to find out if there is any remedy to it.
My setup is this:
Central repo on github.
Personal repo on github (which is a fork of Central)
+Central is setup as remote (upstream/master)
+Master branch (origin/master)
+Feature branch (origin/feature)
My workflow was like this:
Need to fix something in Central:
1. checkout Master
2. Make changes
3. Pull from upstream/master and merge
3. Commit, push to upstream/master
Need to work on a New Feature:
1. Checkout/Create Feature branch
2. Work work work
3. Pull from upstream/master and merge
4. Commit, push to upstream/master
This way I always had a pristine state of Central in my Master branch.
Now what I did was started working on Master branch instead. So I made changes to my master and can no longer branch from it to get a copy of Central. Whenever I need to make and push some fixes to Central, i have to clone the Central into another directory and work from there.
My question: Is there a way to "revert" my master to be an identical copy of the Central, while moving all the changes I have made on my Master into another branch (say Feature)?
I know it's confusing, and I would appreciate any help. I will clarify if anything is unclear.
|
Create git branch, and revert original to upstream state
|
The error message says it all
ERROR: Repository not found.
Is there a Git repository where you're looking?
You need to create the repository on GitHub first. It can't find the repository because it doesn't exist yet!
|
I created a directory, hello_git. In this directory I created a file, hello_git.py, which prints out a "Hello git!" message.
Then I made hello_git my current directory in the terminal and entered the following commands one after another in that directory:
git init
git add hello_git.py
git commit -m 'first commit'
git remote add origin [email protected]:githubaccountname/hello_git.git
When I enter the command git push origin master I get asked:
Enter passphrase for key '/home/myusername/.ssh/id_rsa':
When I enter my passphrase (which authenticates successfully using ssh -T [email protected]) I get this:
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
I don't know if this helps, but:
git remote -v
returns:
origin [email protected]:githubaccountname/hello_git.git (fetch)
origin [email protected]:githubaccountname/hello_git.git (push)
I have looked into answers of similar posts, but nothing seems to work:
Fatal: The remote end hung up unexpectedly while pushing to Git repository
GitHub ERROR: Repository not found. fatal: The remote end hung up unexpectedly
How do I resolve this issue of preventing push to origin wrt. GitHub?
|
GitHub: ERROR: Repository not found. fatal: The remote end hung up unexpectedly (different from similar posts apparently)
|
Medium have said in their Twitter support feed that it's an issue that only affects the editor but it should look fine when published:
Hi Ayush! This is a known issue that only affects the editor. The gists will be displayed properly once the post is published. Sorry for the trouble!
|
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
When I try to embed gist in Medium it shows only the first 11 lines of the gist while code is longer inside gist. How can be this fixed?
|
Gist is not showing completely in Medium [closed]
|
It should be possible since Jan. 2022, 6 years later.
Unwatch all repositories owned by a given user or organization
Users can now unsubscribe from all repositories owned by a given user or organization.
Navigate to github.com/watching to find a list of the repositories that you are subscribed to.
The Unwatch All button gives you the option to unsubscribe from all repositories, or just the ones that belong to a specific user or owner.
It will appear when you are watching all activity or custom notifications on over 10 repositories.
Clicking any of the dropdown options opens a modal to confirm unwatching repositories owned by the selected user/organization (or all repositories).
You can read more about how to unwatch a single or multiple repositories in the 'Managing your subscriptions' documentation
|
After you join an Organization on Github you automatically subscribed to all of its repos and you start getting all those updates you don't really want. To unsubscribe you need to go per repo and do it manually. Is it possible to unsubscribe from all repos within a particular Organisation at once?
|
How to unsubscribe from all repos within an organisation
|
Do you have to be the repo owner?
Yes you do.
How to set the default branch on github.com when I go to browse commits.
If you fork the repository, you can change the default branch of your fork, by clicking on the Settings button (see below).
This will allow you to pick your favorite branch as the default one for your own fork, but you'll have to keep your forked repository in sync with the upstream repository by yourself.
Or you can directly jump to the following url https://github.com/{:user}/{:repo}/settings
|
I found the following info, but didn't find where to go to access it. Didn't find it in account settings. Is there a repo settings page? Do you have to be the repo owner?
https://github.com/blog/421-pick-your-default-branch
How to set the default branch on github.com when I go to browse commits.
|
How to set the default branch in GitHub.com?
|
For anyone looking to change an existing TortoiseGit installation to use PuTTY rather than OpenSSH, simply right-click, -> TortoiseGit -> Settings -> Network, then change 'ssh.exe' to 'tortoiseplink.exe'. From then on, doing a push/pull should be using Pageant (and any keys you have set up in there) if you also have that running.
|
I have just installed Git For Windows, and created my SSH key using SSH through Cygwin. It seems to be working from command-line and the Git For Windows GUI, but now I want to use TortoiseGit. TortoiseGit uses a Putty-like SSH client by default but apparently GitHub only accepts (open)SSH, and I don't really know how to proceed. I will be doing a clean TortoiseGit install, I already have Cygwin and Git for Windows installed.
|
How to install/setup TortoiseGit to work with GitHub
|
I would recommend using tags (tag tutorial)
From your master branch since you are done v1.0 add a tag called v1.0.
git tag -a v1.0 -m "Tagging release 1.0"
This way you can always come back to a specific version at any time by calling git checkout [tag_name]
Another common practice is to use branches to work on features until they are stable.
git checkout -b [feature-branch]
That creates a new branch named whatever is in [feature-branch] and checks it out. Be sure to do this from where you want to start working on the feature (typically from master).
Once stable they can then be safely merged into master. From master run:
git merge [feature-branch]
This way your master branch always stays in a working state and only completed items get added once ready. This will allow you to keep a working copy of the app at all times (ideally anyways) for testing, etc.
You could use branches for each version of the application however using tags makes it so you can't merge into another branch version by accident.
|
I am using git and github, and I just finished the 1.0 version of my iOS app. From here, I am wondering how git can best serve me.
I really am just looking for a best practice here, and what others recommend for managing major versions.
Should I create a new branch for each new version, such as for 1.1, 1.5, 2.0, etc? Or should I just keep pushing to the master branch? If so, how do I do this?
|
Git: Manage each version of my app?
|
The most straightforward way to use Pipeline with GitHub pull requests is to put the script into your repository under the name Jenkinsfile and then install the GitHub Branch Source plugin. Documentation
|
It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs.
How do you configure a pipeline job to be triggered from a GitHub pull request event?
The documentation on this topic is sparse and I cannot find any examples of this. Or is it better to create a web-hook in GitHub to trigger the pipeline job on the PR event?
|
How to trigger a Jenkins 2.0 Pipeline job from a GitHub pull request
|
all of the previous answers are great. however if you are looking for a quick and dirty example of how to get a list of publicly available repos then check out my jsfiddle.
which uses this ajax call to list all of a users public repos:
$("#btn_get_repos").click(function() {
$.ajax({
type: "GET",
url: "https://api.github.com/users/google/repos",
dataType: "json",
success: function(result) {
for(var i in result ) {
$("#repo_list").append(
"<li><a href='" + result[i].html_url + "' target='_blank'>" +
result[i].name + "</a></li>"
);
console.log("i: " + i);
}
console.log(result);
$("#repo_count").append("Total Repos: " + result.length);
}
});
});
to see what kind of data is returned just check the console after clicking the button or you can install Google Chromes JSONView extension and then just visit the url that the ajax request is making i.e. https://api.github.com/users/google/repos
|
If I was to go about displaying just MY github repositories and their contents on an external website how would i go about doing this? Are there any source code's you can provide me with, if not point me in the right direction? I'm quite a beginner to programming so any help is appreciated. Thank you everyone.
Taking a glance at their website
I glanced over relevant links- but still have no clue how I would accomplish this.
-Github List all Repo's
-Github List all Repo content
|
Github API List all repositories and repo's content
|
Note that the problem with the #Lxx-Lyy is that (from this post):
source files are subject to change, or even be removed, so there’s no guarantee that your link will always point to the correct place.
By default, GitHub project pages link to the most current version of the source. A better practice is to link to a specific commit, where the content of source files are not subject to versioning.
To view a GitHub project at a certain commit, click on the tree link in the commit header, or just press t on your keyboard. You can then browse the project files, and link to sources of this commit, i.e.
http://github.com/jquery/jquery/blob/27291ff06ddb655f90a8d1eada71f7ac61499b12/src/css.js#L171-L185.
Note that the only difference in the URL is changing the branch name master with the commit SHA.
+1 tip from Paul Irish:
plus you only need 4 characters of the SHA in the URL... it figures it out.
I usually truncate to 7ish characters.
Nice: http://github.com/jquery/jquery/blob/27291ff/src/css.js#L171-185
If you have a GitHub page which does not reference a sha1, type y:
that will reload that same page with the current SHA1.
|
If you want to add a reference to a specific line or a range of lines, it would be nice to get an URL that does that.
|
How to refer to a specific line or range of lines in github?
|
Any of the following will work:
Just transfer ownership of the repo to another user and have them add you as a collaborator.
If someone forks your repo, then you delete the original, their fork is still there, unless it's a private repository. they can then add you as a collaborator on their fork repo.
Another user can simply clone your repo (commits intact), create a new repo on GitHub, add the new repo's remote info, and push your repo up to their new one. (Then, they can add you as a collaborator.)
|
There are many answers on Google that point in the same direction, but when it comes to version control I don't want to try anything and then mess up my repository.
I have set up a repository on GitHub and would like to move it to another user, so that I can close the repository. He would then invite me to the repo once it belongs to his account. I guess this is quite a common use case for working with clients - once you finished the project, you hand it over to them.
Now, assuming this is possible, how would I change my local Git settings in the project so that I am now pushing to/pulling from the new location? And, by moving the repo, would I lose the commit history?
|
Move git repository to another github user
|
45
I wouldn't commit any specific IDE configuration into the repository.
2 important reasons are:
IDE configuration almost always involves absolute paths in disk, where different users may not have the same...
You don't want to constraint all users to use the same IDE config...
Share
Improve this answer
Follow
answered Aug 1, 2015 at 17:33
Daniel Conde MarinDaniel Conde Marin
7,64644 gold badges3636 silver badges4444 bronze badges
7
2
What about code formatting? Code style? Copyright info? This is present in the .idea folder..
– nhaarman
Aug 1, 2015 at 17:44
4
@nhaarman: if by code formatting you mean tools like jslint etc (code style...) those have separate configs which should be persisted to the repository.
– Daniel Conde Marin
Aug 1, 2015 at 17:48
17
Just ignore .idea/workspace.xml and .idea/libraries
– diegomercado
May 17, 2017 at 20:43
3
This opinion is one of the things that make the Java development ecosystem a nightmare of yak shaving.
– jpierson
Jun 12, 2018 at 13:42
1
It seems like this is informed in the spirit of FOSS projects where one will have a lot of heterogeneous developer workflows. Should this advice apply to teams that all use the same tooling?
– Winny
Jul 7, 2021 at 14:42
|
Show 2 more comments
|
This question already has answers here:
IntelliJ IDEA 9/10, what folders to check into (or not check into) source control?
(7 answers)
Closed 8 years ago.
Should I commit my idea folder in git and in remote version controls like Github? Is it a good practice?
|
Should I commit my `.idea/` folder? [duplicate]
|
Yes, you can manually accept certain commits using git-cherry-pick and then close the pull request.
https://help.github.com/articles/using-pull-requests
|
Say you've got a user who made a few commits and rolled them into one pull request. You want to accept one of the commits, but reject the others. Is this possible with GitHub?
|
GitHub: Accept Pull Request, But Only Some Commits
|
You might not have to fix anything anymore (July 2020, 3 years later)
See:
Pull request commits now ordered chronologically
We are changing the way commits are ordered in the pull request timeline and commits view.
Commits are currently ordered by author date, which can cause commits to appear out of order in some scenarios, like after rebasing.
With this change, commits are ordered according to their chronological order in the head branch, which is consistent with the ordering in Git.
This ordering is also reflected in the List commits on a pull request REST API and PullRequest object's timeline connection in GraphQL.
Learn more about pull requests
|
When I write code I break it into small logical changes that are easy and quick to review.
To do so, I use git rebase -i (interactive) to squash, drop and change order of commits.
I've noticed this sometimes leads to a different order of commits on a GitHub pull request (though the order is retained on the remote branch).
For example,
commit 1
commit 2
commit 3
might show up in the PR as:
commit 3
commit 1
commit 2
I've searched the internet and only managed to find this GitHub help page: Why are my commits in the wrong order? Their answer:
If you rewrite your commit history via git rebase or a force push, you
may notice that your commit sequence is out of order when opening a
pull request.
GitHub emphasizes Pull Requests as a space for discussion. All aspects
of it--comments, references, and commits--are represented in a
chronological order. Rewriting your Git commit history while
performing rebases alters the space-time continuum, which means
that commits may not be represented the way you expect them to in the
GitHub interface.
If you always want to see commits in order, we recommend not using
git rebase. However, rest assured that nothing is broken when you
see things outside of a chronological order!
Is there a way to work around this?
|
How to fix commit order in GitHub pull requests, broken by git rebase?
|
Say if you have 3 pull requests A,B,C which are on three branches bA,bB,bC. and your main branch is master.
First get all of his branches to your local repo without merging it.
git fetch his-repo
so now your repo may have four branches: master, bA, bB, bC
I will create a branch from master called f-merge-his-repo
git checkout master
This makes sure that f-merge-his-repo branches out from master.
git checkout -b f-merge-his-repo
This creates the branch f-merge-his-repo and switch to it.
So now you are currently on f-merge-his-repo, use the following commands:
git merge bA
git merge bB
git merge bC
If there are conflicts you should fix it(manually or using a mergetool), but as you said there are no conflicts, so we say that bA bB and bC are now all in f-merge-his-repo
then, just simply merge master, bA, bB, bC0 into your master branch
You should first switch to the master branch.
master, bA, bB, bC1
And then merge f-merge-his-repo
master, bA, bB, bC2
or if you prefer a none fast forward merge
master, bA, bB, bC3
After all, delete these branches.
master, bA, bB, bC4
master, bA, bB, bC5
master, bA, bB, bC6
master, bA, bB, bC7
You should really take a look at master, bA, bB, bC8 here. It is a simple book which shows you everything you need with git in your daily work, and believe me, once you get used of git bash, you will find all of these git GUI's frustrated(except viewing the log, I use gitk to view and analyse the log)
Last tip:
A good way to remember master, bA, bB, bC9 and f-merge-his-repo0 is like
Merge is merging another branch TO your current branch (of course you can name both branches, but the default syntax is merge the branch to your current branch)
so you should always switch to the main branch and merge others branch
f-merge-his-repo1
f-merge-his-repo2
or
f-merge-his-repo3
And rebase is rebasing your current branch ON another branch(usually the main branch)
f-merge-his-repo4
f-merge-his-repo5
|
Someone has submitted a set of pull requests to my repository on github. Unfortunately they've done this in several pull requests (one for each file) rather than submitting all the pull request for all the files in one go.
After requesting him to merge them as one - and not getting any response I'm now trying to merge these pull requests together myself in the Git Bash - but having little luck - I'm quite happy using the merge buttons and making commits through the GitHub program on windows but little more. I have no real understanding of the git shell - so if someone could go through the process of how I can merge these pull requests together (none of them conflict in anyway) it would be much appreciated.
|
Merging pull requests together
|
You certainly should be able to create a new one with the same name. I'm fairly sure I've done this before.
I'd leave it for 5/10 minutes and try again if I were you.
|
Through the github web interface I created a new repository. I forgot to chose some options at creation time and thought I'd delete the new, empty repository and start again.
I deleted the repository but now cannot create a new repository with the same name as one that was deleted. I get a 'Name already exists on this account' error when I try.
I don't know if this is a permanent matter (i.e. I can never create a new repository named the same as one that has been deleted) or just a temporary matter perhaps due to some information being cached which will later be cleared.
Can I create a github repository named the same as one that existed but was deleted?
|
Can I create a github repository named the same as one that existed but was deleted?
|
I'd say that with published work, you should just always use annotated tags. That extra information is never going to harm you.
Lightweight tags strike me as being more for when you're being lazy. Maybe a temporary tag (just make sure you don't accidentally push it; really you could just use a branch), or maybe a personal repo where there's not much use for the extra information. My guess is that a lot of smaller projects do this too; they're just not really concerned with the information. Probably there's only one integrator, no one's concerned with verifying signed tags, and they're just simple markers of release versions. (I still think you should prefer annotated tags, just in case!)
Another way of thinking of it: lightweight tags are kind of like writing a really bad commit message. You really shouldn't do it, but sometimes people do, usually when no one's watching.
|
I am aware of the technical differences between the two types of commands (usage without the -a flag creates a lightweight tag which is essentially a branch that never moves, while usage with -a creates a full object in Git's object database which includes the committer's name, email, etc.).
The question is: which one should I use in my projects (to indicate release versions on Github, for example)? And if one is hugely preferred over another, why does the other option exist? What are the use cases for each version?
|
In what circumstances should I add the `-a` flag to the git tag command?
|
Github pages are not a proper place for an update site.
Github pages may not properly serve large binary files as explained in this issue. It may be fine if your jars are small but overall they advise against placing binaries there. Instead they recommend placing binaries in the download section of the repository. I'd be happy if this situation changes because it would be very convenient to publish an update site by pushing to github.
For now one would have to use their API to programatically upload files in the download section. Answers to this other question points to some libraries and scripts that uses this API for use within java/maven, perl, ruby, etc.
|
I am using GitHub to develop an Eclipse plugin. I would like to have a public Eclipse update site for my plugin. Can I use GitHub for this?
I know that GitHub can be used for hosting individual files by using the "raw" links provided on the file information pages.
|
Is it possible to host an Eclipse update site on Github?
|
22
My solution was to change the Git version from 'Use Embedded Git' to 'Use System Git'. Because I installed GitHub on my computer earlier, it seems SourceTree chose that Git by default rather than download the embedded version when it was installed.
Share
Improve this answer
Follow
edited Jun 9, 2014 at 18:51
nobody
19.9k1717 gold badges5757 silver badges7777 bronze badges
answered Jan 16, 2014 at 13:57
Y ZhangY Zhang
22322 silver badges66 bronze badges
3
1
This wasn't the exact solution to my problem - but it pointed me in the right direction. For me, when I went to the "Git" tab, it showed that it was disabled. I enabled it, and it all worked fine after that.
– Origin
Jul 28, 2014 at 4:09
This fixed my issues and made it so local repos would clone correctly from remotes within our network.
– Ian Lewis
Mar 30, 2015 at 10:09
1
Origin's comment helped... I had to enable git in source tree..Saved my day!!!!!!!!!!!!
– Sunny Shah
Nov 16, 2015 at 12:01
Add a comment
|
|
Can someone give me a quick walkthrough on simply cloning a repo with SourceTree?
In Bookmarks, I click on Clone Repository. For Source Path I paste in the URL which looks like this:
[email protected]:client/appname/ios-application.git
But I get "This is not a valid source path / URL".
I'm copying directly from the Repository Browser in codebase so I know the URL is correct.
What else do I need to do?
|
Cloning a repository with SourceTree
|
Solution for chrome:
Install Stylist @ https://chrome.google.com/webstore/detail/pabfempgigicdjjlccdgnbmeggkbjdhd
Install userscript @ http://userstyles.org/styles/39502/github-a-different-font-stack-for-code-listings
Enjoy!
|
I am unhappy with the default code font of github which is Courier New. I want to change it to Monaco, which is my preferred monospace font. Is it possible to change my github code font? If yes, how?
|
Changing the default github code font
|
16
Edit
This extension is no longer needed as this answer shows GitHub now implements this functionality natively
Previous
I wrote a chrome extension to enable this. Source on github.
Share
Improve this answer
Follow
edited Mar 1, 2023 at 3:00
answered Oct 3, 2015 at 10:42
Stafford WilliamsStafford Williams
9,75699 gold badges5252 silver badges103103 bronze badges
5
Bit of an older thread, but are you maintaining this? Because it doesn't seem to work currently :( Here's a commit with a few moves: github.com/Rene-Sackers/gta-network-typescript/commit/…
– René Sackers
Apr 11, 2017 at 16:33
You need to be looking at the history of a file rather than a commit, e.g: github.com/Rene-Sackers/gta-network-typescript/commits/…
– dsturbid
Apr 27, 2017 at 16:29
11
Why on EARTH is this something that needs a browser extension ?!?
– Alex McMillan
Jun 7, 2017 at 22:35
Doesn't work anymore, apparently: github.com/Rene-Sackers/gta-network-typescript/commits/master/…
– Dorian Marchal
Apr 3, 2019 at 12:21
1
@DorianMarchal I still see it: imgur.com/a/tHkeWQ9. If you don't see that, open an issue and I'll have a look - github.com/staff0rd/github-follow-extension/issues
– Stafford Williams
Apr 3, 2019 at 19:47
Add a comment
|
|
After renaming a folder (git mv foldername newfoldername) the history of this folder in Github has gone. I can still view the full history of any file in the folder if I clone the repro and run...
git log --follow ./newfoldername/file
But is it possible to get history for renamed folders visible in Github?
This is a Github question, the git revision history is working as expected.
Thanks
|
See history in GitHub after folder rename
|
16
There is no such access-rights-mechanism implemented on GitHub repositories out of the box.
Using a submodule
Using a submodule does the trick, and is pretty much easy to set up. You can give the customers full access to the submodule repository, while you add it to your main project repository.
Note that the StackOverflow question "Using someone else's repo as a Git Submodule on GitHub" and its answer are also worth reading.
This is in my opinion the most simple and straightforward way to do it.
Using a webhook
If you really don't want to use submodules, you can still restrict access rights by creating a GitHub webhook that implements this mechanism. The Git SCM documentation explains how to do that part.
Share
Improve this answer
Follow
edited Jul 23, 2020 at 12:32
hey
2,92377 gold badges3030 silver badges5252 bronze badges
answered Nov 16, 2016 at 9:14
dashdashzakodashdashzako
1,3181515 silver badges2424 bronze badges
Add a comment
|
|
I have 10 main folders in this project I want to give access to the external team just in one sub-folder in my git repository so that they can make changes and submit a Pull Request.
Is there a way of doing it? If not, can you please suggest a better way?
|
Give permissions on project folder in github
|
There are a number of workflows you can use here. Some examples are:
Comment on the pull request, and have Bob make some changes. See Pull Request Discussion for more info.
Merge the pull request onto a different branch, then make your changes before merging to master. You need to do this from the command line; see Merging a Pull Request for step-by-step instructions.
Edit the patch before applying it with git am. See Patch and Apply. This is probably the most flexible option, but also the most manual.
git checkout master
curl http://github.com/<username>/<project_name>/pull/<patch_number>.patch
sensible-editor <patchfile>
git am <patchfile>
git push origin master
|
Here's the scenario:
I have a public repo A. Bob forks A, adds a few commits to Bob/master and submits a pull request to merge those changes in A/master. I'd like to make a few changes to the proposed pull request before merging it back to A/master.
How can I do that if I can't push to Bob/master?
|
How can you add commits to a github pull request of another person to your repo if you can't commit to their branch?
|
16
There is simply not a "Import issues from JIRA" feature in GitHub.
The way I see it you have two options, either to integrate your current JIRA instance with GitHub or migrate the JIRA issues into GitHub issues using your own criteria and migration script.
GitHub and JIRA Integration
I would very much like to add all the instructions here but it's one of those cases where a link to the documentation makes much more sense.
There's also a video on youtube which is quite short and easy to follow.
Migrating JIRA issues into GitHub Issues
In order to do this you would have to write your own script that reads issues from the JIRA REST API and creates new ones using GitHub Issues REST API.
Note that JIRA and GitHub issues are different in nature, so your script would have to choose how to migrate one type of issue to another.
I hope this helps.
Share
Improve this answer
Follow
edited Jan 18, 2021 at 9:09
Jonas Sourlier
14.1k1717 gold badges8181 silver badges150150 bronze badges
answered Jun 29, 2015 at 23:08
bitoiubitoiu
7,13355 gold badges4242 silver badges6060 bronze badges
1
1
Your documentation link is broken
– Rob
Feb 24, 2020 at 15:53
Add a comment
|
|
I've tried exporting issues from both GitHub and Jira to CSV files, but I've never tried exporting Jira issue then importing it to GitHub, is this possible? If so, what would be the best way to approach something like this?
|
Is there a way to import Jira issues to GitHub?
|
13
The easiest way to find a file in a repository is to use the file finder. You can activate it at any time when you are in repository view by pressing t. See this screenshot from the official annoucement:
The file finder will perform some fuzzy matching using the characters you input into the "search box".
Share
Improve this answer
Follow
answered Mar 28, 2014 at 19:56
TimWollaTimWolla
32.1k88 gold badges6565 silver badges9797 bronze badges
1
17
In another words, the answer should be: No, you can not.
– Smuuf
Nov 13, 2017 at 14:47
Add a comment
|
|
I want to search a repository for any files that end in *Test.java* but if I search for *Test.java* I just get files that contain that exact string.
I can't find any information anywhere that suggests this is possible. Is this just due to limitations of indexing such an enormous amount of data?
I'd like to find a way to search a repo for all classes ending in Test.
|
Can I do a wildcard (*) search on github.com?
|
With version 2.13 of Git and later, --recurse-submodules can be used instead of --recursive:
git clone --recurse-submodules -j8 git://github.com/foo/bar.git
cd bar
Editor’s note: -j8 is an optional performance optimization that became available in version 2.8, and fetches up to 8 submodules at a time in parallel — see man git-clone.
With version 1.9 of Git up until version 2.12 (-j flag only available in version 2.8+):
git clone --recursive -j8 git://github.com/foo/bar.git
cd bar
With version 1.6.5 of Git and later, you can use:
git clone --recursive git://github.com/foo/bar.git
cd bar
For already cloned repos, or older Git versions, use:
git clone git://github.com/foo/bar.git
cd bar
git submodule update --init --recursive
|
How do I clone a git repository so that it also clones its submodules?
Running git clone $REPO_URL merely creates empty submodule directories.
|
Git - forgot to use --recursive while cloning [duplicate]
|
If you go to the page and view the links provided by "raw" (in the top left corner, when viewing the file). You will see, that you can access it by:
https://github.com/username/repository/raw/$changeset_hash/path/to/file
Instead of $changeset_hash you can also provide a branch (e.g. master) or tag.
You can retrieve the raw file using something like wget.
Accessing a single file directly from a .git-repository is not possible (as far as I know), because of how the data is stored.
edit: When you want to access a file from a private repo, you first have to create an access token with the appropriate permissions in your account settings. Instead of calling the url above you can then use github's API to access the content of a file. Be sure to use the Accept-header for custom media types to get the raw data. This might look something like this:
curl \
-H 'Authorization: token $YOUR_TOKEN' \
-H 'Accept: application/vnd.github.v3.raw' \
-O \
-L 'https://api.github.com/repos/:owner/:repo/contents/:path'
The -O will save the contents in a local file with the same name as the remote file name. For easier use you can wrap it in a script. @Chris_Withers suggested an edit with a nice python snippet that unfortunately got rejected as to big of a change to the answer.
|
How do I download just 2 files from github using command line ?
Something in the lines of :
git fetch git://github.com/username/Project.git/file1
git fetch git://github.com/username/Project.git/file2
|
Download specific files from github in command line, not clone the entire repo
|
44
You can use the following flags --single-branch && --depth to download the specific branch and to limit the amount of history which will be downloaded.
You will clone the repo from a certain point in time and only for the given branch
git clone -b <branch> --single-branch <url> --depth <number of commits>
--[no-]single-branch
Clone only the history leading to the tip of a single branch,
either specified by the --branch option or the primary branch remote’s HEAD points at.
Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.
--depth
Create a shallow clone with a history truncated to the specified number of commits
Share
Improve this answer
Follow
answered Dec 20, 2016 at 2:14
CodeWizardCodeWizard
134k2222 gold badges154154 silver badges174174 bronze badges
1
Would you know from what Git version that option is available?
– Eric Platon
Dec 20, 2016 at 2:40
Add a comment
|
|
I am new to git version control and I dont know how to clone / pull a specific branch of a repo . Trying to get the branch master of the project, but it defaults to branch test_1
I have tried using the command git clone but it grabbed default test_1. I have also tried reading other questions but the commands are confusing me and I dont want to break anything.
How do i clone the master branch of this project so i can make changes and push to it?
|
Cloning specific branch
|
Use this link as an image:
https://progress-bar.dev/<thepercentage>
Example: 
If you want to add a title like shields.io:
https://progress-bar.dev/<thepercentage>?title=<title>
More documentation can be found here.
|
I want to show the progress of the current iteration of my project on Github Wiki. However I couldn't find a way to do this.
I am looking for something similar to the Bootstrap progress bars without any interaction. Is there a simple way to do this?
|
Is there a way to show a progressbar on Github Wiki?
|
You must downsize the image in an image editor. You can't change image size on GitHub's flavor of markdown.
Also: The image is already very grainy, it's not a result of its size changing.
|
I'm editing a Readme.md file in a Github repository and have inserted a picture (see https://github.com/khpeek/FMCW-radar). The picture takes up the full width but is rather grainy that way, and I would prefer to make it smaller. Is there any way to do that?
P.S. I've tried the commands on
How to change image size Markdown?, but they don't seem to work.
|
How to I change the size of an image in Github/Markdown?
|
I thought the answer by @codewizard was the correct one. Seems VS Code uses 'id_rsa.pub' key only, it was not using my other ssh key pair that git.exe was configured to use.(This key wasn't name id_rsa.) However after generating a new id_rsa key pair, I still got permission denied (publickey).
I Found my answer on this blog entry, seems vs code doesn't have a ssh-agent to interact with?
http://blog.alner.net/archive/2015/08/24/vs_code_with_git_ssh_keys_that_use_passphrases.aspx
The solution on the blog being
Open a command prompt.
Run "start-ssh-agent" and answer passphrase
prompts.
Run "code" to launch VS Code from that environment.
I used git-bash
start the ssh agent: eval "$(ssh-agent -s)"
then "code" to launch VS Code
Note: As @JoshuaH points out in the comments, you can create a windows shortcut to simply the steps above.
cmd /c start-ssh-agent & code
git fetch started working. However I started to get a openssh passphrase box every x minutes(untimed)
so I then rechecked the key was added
again using git-bash
then "ssh-add ~/.ssh/id_rsa"
then git config --global credential.helper wincred
If you want a password prompt every time, then ignore the two previous commands and disable autofetch in VS Code's settings.
"git.autofetch": "true" in VS code settings to "git.autofetch": "false"
|
I started studying Git and GitHub.
And now, I could create my repository to practice and I could push commits to origin repository(in GitHub) on git bash.
But when I tried to push on Visual Studio Code, I have received this error
Permission denied (publickey).
fatal: Could not read from remote repository.
and failed to push to origin repository.
but I already remote local repository to origin repository with ssh key on git bash and I could complete push and pull between local repository and origin repository.
In others' case, they were asked GitHub credentials to push or sync, but in my case, I could not be asked any credentials like ssh key.
In this case, What should I do? Thank you.
|
To use <git push> on Visual Studio Code, but show "Could not read from remote repository."
|
It will probably be a lot easier to use branches, rather than using separate forks. You can still have separate checkouts for each branch; just clone your repo multiple times, and use git checkout in each one to switch it to the appropriate branch (or git checkout -b to create the branch and check it out all at once). Once you have created the branches, you can push them to GitHub using git push origin <branchname>.
|
So, total newbie to Git. Been reading through the guides and think I have the basics but am having difficulties accomplishing this one goal.
I have a repo created for my generic markup source code. Just stuff I reuse for every breakout. It's called markupDNA.git
I would like to have different directories in my mac sites dir ~/Sites/project-N. Where I build upon the generic stuff and do a breakout of a site. I would like these to be tied to my main git repo as forks, but you cannot fork your own repo?
I wish I could do something like this:
git clone <url> name
git add .
# make changes
git commit -m 'whatever'
git push
But I don't want it to push to origin. I want it to push to a fork of the markupDNA repo whence it was cloned. But it seems like it just pushes my changes right up into the origin master. The idea is to keep the markupDNA clean and just have a lot of forks for my different projects, each of which will have their own cloned dir on my hard drive.
Any ideas?
|
How can I fork my own GitHub repository?
|
The command you're looking for is actually ssh-keyscan and you can easily find it using pkgs.alpinelinux.org/contents.
|
In order to successfully clone a private repository into an Alpine-based docker, I needed to run the following command:
ssh-keyscan github.com >> ~/.ssh/known_hosts.
But since ssh-keyscan isn't part of Alpine linux (by default), I have to install it first with apk. The problem is: I dont know how - and I can't find it anywhere on Google.
|
Installing ssh-keyscan on Alpine linux?
|
Not sure, this is what you expect.
git fetch origin
git reset --hard origin/master
git clean -f -d
The above commands will synchronize the remote repo with the local repo. After the above command execution, your local repo will be like the mirror image of your remote repo.
If you want to retain the changes as unstaged files, use --soft instead of --hard.
WARNING: All your untracked files will be gone when you do git clean -f -d.
Lemme know, if any questions.
|
I push code from two main locations: my PC at home and my laptop at work. I use Github to store my repos.
This is the scenario: I did some work in my PC on a repository I've been working on for some time (both in my PC and in my laptop), and ended with the following branches:
$ git branch
* master
* v123
* test-b
which I pushed to Github. So far so good.
Now I'm on my laptop and this is what I see before attempting to pull anything:
$ git branch
* master
* v_123
This is an old version of my repo in my laptop (since I've been working in my PC) where the differences are: a branch is missing (test-b), another one has been re-named, or equivalently deleted and re-created with a new name (ie: v_123 is now v123), and lots of things have changed possibly in all branches.
I want to sync all my branches into my laptop and have them correctly tracked. I've looked at two of the most up-voted questions regarding branch cloning/fetching (How to clone all remote branches in Git?; How to fetch all git branches) and right now I'm a bit lost.
Is there some easy to use git sync-branch --all command that can be used to sync my laptop with the latest state of the repo in Github?
|
Sync all branches with git
|
Experimenting revealed I can prevent this behavior by escaping the period:
1\.first
2\.second
2\.second
3\.third
|
How can I disable auto-incrementing list numbers in a markdown file?
What I'm trying to display:
1.first
2.second
2.second
3.third
What is being displayed:
1.first
2.second
3.second
4.third
Is there an easy way to disable this?
|
How to prevent/disable automatic list number incrementing in markdown?
|
There is a good chance you have special characters somewhere in your commands according to these two SO posts:
git: fatal: I don't handle protocol 'http'
Git Fetch returns 'fatal: I don't handle protocol https' in windows
Retype the commands and the problem should be alleviated.
|
This question already has answers here:
Git Fetch returns 'fatal: I don't handle protocol https' in windows
(9 answers)
Closed 7 years ago.
I am trying to push some of my files from staging area to my repository.
git remote add origin https://github.com/my_name/filename.git
git push -u origin master
fatal: I don't handle protocol 'https'
I am getting this fatal error.
How to fix this ?
|
fatal: I don't handle protocol 'https' [duplicate]
|
The GitHub user interface will default the option to the last option selected by the user for the current project. This solves the issue of not accidentally using the wrong default, since after the merge is done correctly for the first PR, subsequent merges will have the desired default.
This solution isn't perfect. If a user makes an intentional one-off merge of a different type, they will need to remember to set it back for their next merge, as the default will have changed to what was intended to be a one-off deviation from the norm.
|
I'm working on a project where "squash and merge" is the preferred approach for merging pull requests. Is there a way to make this the default option in GitHub, either for my own user, or for the project?
As it stands, it's entirely too easy to select the default option (Create a merge commit). This is made especially problematic by the fact that it is not easily undo-able, given that you generally should not be modifying repository history.
Note that this is different than How to make --squash default on a merge?, as that one refers to the command line usage of Git, whereas my question concerns functionality within the GitHub user interface.
|
Is there a way to specify a default option for merging a pull request in GitHub?
|
I also wanted to do this. I tried uploading an .htaccess file with contents Options +Indexes to the relevant directory, but that did not work.
So, I used your option #2, writing a tiny Python script to generate an index file for the directory.
""" Build index from directory listing
make_index.py </path/to/directory> [--header <header text>]
"""
INDEX_TEMPLATE = r"""
<html>
<body>
<h2>${header}</h2>
<p>
% for name in names:
<li><a href="${name}">${name}</a></li>
% endfor
</p>
</body>
</html>
"""
EXCLUDED = ['index.html']
import os
import argparse
# May need to do "pip install mako"
from mako.template import Template
def main():
parser = argparse.ArgumentParser()
parser.add_argument("directory")
parser.add_argument("--header")
args = parser.parse_args()
fnames = [fname for fname in sorted(os.listdir(args.directory))
if fname not in EXCLUDED]
header = (args.header if args.header else os.path.basename(args.directory))
print(Template(INDEX_TEMPLATE).render(names=fnames, header=header))
if __name__ == '__main__':
main()
|
I need to display directory contents on GH Pages.
Would prefer
Automatically, without index.html
A tool or library for automatically generating the index.html
Any other method
So, if I have a FS in my GH Pages repository:
http://github.com/[username]/[username].github.io/ :
script/
- app/
- core/
- init.js
- lib/
- Element.animate.js
- Object.overlay.js
- mod/
- anim/
- global/
- carousel/
- carousel.js
- global.js
- ext/
- cfgs.js
index.html
I would want each directory URL to index as usual, like so.
http://[username].github.io/script/ :
- app/
- lib/
- mod/
- ext/
http://[username].github.io/script/mod/anim/global/ :
- carousel/
- global.js
The only thing I can think of is preference #2, write or find a script to automatically generate the index.html from the GitHub Repo page or the local Repo on my FS.
|
How to Enable Directory Indexing on GitHub Pages
|
40
Github search has provided such function,it's Linus Torvalds:
most followers
Share
Improve this answer
Follow
answered Aug 13, 2014 at 3:06
leafonswordleafonsword
2,90533 gold badges1717 silver badges2121 bronze badges
Add a comment
|
|
For example:
Person who having most followers
Person who having most repos
person whose total repos having most stars
|
How to find most popular person in GitHub?
|
Github now provides a "Latest release" button on the release page of a project, after you have created your first release.
In the example you gave, this button links to https://github.com/reactiveui/ReactiveUI/releases/latest
|
I want to add the Download Latest Version button to my project website which would represent the link to the latest release stored at GitHub Releases.
I've tried to create a release tag named latest, but it became complicated when I tried to load a new release (confusion with tag creation date, tag interchanging, etc.). Updating download links on my website manually is also a time-consuming and tedious task.
Note that my website is hosted statically, so I simply can't use server-side scripting to generate links. Any ideas?
|
Download latest GitHub release
|
How to download repository
# download a repository
git clone <url>
How to push changes in selected branch
# push changes to remote branch
# assuming you are on the master branch right now
git push origin master
How to select branch to push
# push any desired branch to remote
git push -u origin local_branch_name:remote_branch_name
|
Can you explain me how to use git in case, when I have access to repository:
How to download repository
How to push changes in selected branch
How to select branch to push
I tried these steps
git init
git clone git.repository
git pull develop (where develop is branch)
git add .
git commit -m "m"
git push origin develop
Result is:
* branch develop -> FETCH_HEAD
fatal: refusing to merge unrelated histories
What I do wrong?
|
How to push changes to branch?
|
20
You need to create the repo before pushing, but there's hub that automates this for you:
git init newRepo
cd newRepo
hub create
Use the -p switch to hub create to create a private repository. To push the local master branch, issue:
git push -u origin HEAD
The tool can also create pull requests, open the project page, check the CI status, clone existing repos by specifying only username/repo, and a few more things.
The project page suggests aliasing git to hub (because the latter forwards unknown commands to git), but I don't recommend this, even if just to distinguish "bare" Git commands from the git init newRepo
cd newRepo
hub create
0 candy.
Share
Improve this answer
Follow
edited Feb 1, 2016 at 7:54
answered Feb 1, 2016 at 7:32
krlmlrkrlmlr
25.4k1414 gold badges123123 silver badges219219 bronze badges
3
3
you need to install hub for your environment from here github.com/github/hub#installation first
– Mahesh Jamdade
Oct 14, 2019 at 11:13
can it fetch username and password from saved config file?
– alper
Feb 20, 2021 at 20:03
You need to authenticate once, this stores a token in the user profile that is later used to access GitHub.
– krlmlr
Feb 22, 2021 at 4:20
Add a comment
|
|
I have been trying to push my local repo changes to github from command line. I have been away from git for a while now so I don't remember a few things. For the past hour I have been trying to push the repo without creating a remote repo on Github.com. As far as I remember, git push origin master/ git push is enough to push the local changes and if necessary create a repo on the remote server. However git push wouldn't let me push and automatically create the repo.
So to save time, I created remote repo on github.com and add the remote repo url using
git remote add origin https://mygithubrepoUrl.com
and it worked.
Is it necessary to create remote repo on Github and then add this url from command line to push changes? Can't Git automatically create repo and push changes?
|
Create a GitHub repository from command line
|
Wildcards are supported by now if you enable the file_glob option. This is how I deploy a build .deb file to GitHub releases:
before_deploy:
- export RELEASE_PKG_FILE=$(ls *.deb)
- echo "deploying $RELEASE_PKG_FILE to GitHub releases"
deploy:
provider: releases
api_key:
secure: YOUR_ENCRYPTED_API_KEY
file_glob: true
file: "${RELEASE_PKG_FILE}"
on:
tags: true
Setting up is easy by executing travis setup releases with a dummy filename and modifying .travis.yml afterwards.
|
I have created a simple travis configuration which packages an app and tries to deploy the archive file to github.
The problem is, I would like to have the version number part of the file name, so i require to use a pattern for the filename. I simply can't get it to work.
Configuration is currently:
deploy:
provider: releases
file: "build/distributions/worktrail-app-hub-sync*.zip"
on:
repo: worktrail/worktrail-app-hub-sync
tags: true
all_branches: true
But it fails with: "/home/travis/.rvm/gems/ruby-1.9.3-p547/gems/octokit-3.3.1/lib/octokit/client/releases.rb:86:in `initialize': No such file or directory - build/distributions/worktrail-app-hub-sync*.zip (Errno::ENOENT)" - but the file is certainly there: build/distributions/worktrail-app-hub-sync-0.0.1.zip
Example run: https://travis-ci.org/worktrail/worktrail-app-hub-sync/builds/35704111
travis.yml: https://github.com/worktrail/worktrail-app-hub-sync/blob/0.0.1/.travis.yml
Is this supported by travis deployment, or is there any workaround for this use case?
|
How to deploy to github with file pattern on travis?
|
Click on the Settings button on the GitHub page of your project and uncheck Wikis.
It should disappear.
|
I'm new to GitHub. When I clicked a Wiki link a new Wiki was created for my repo. But I don't really need it. If I try to delete its only page, GitHub asks: "Are you sure you want to delete this page?". And I confirm that. And nothing happens, the page is still there. I can't say it's too annoying, but I'd like to know if there is a way to delete Wiki.
|
Delete GitHub repo's Wiki
|
remove the file from tracking:
git rm --cached config-dev.php && git commit -m "config-dev.php"
add it to the .gitignore
echo config-dev.php >> .gitignore
git add .gitignore
git commit -m "adding config-dev.php to .gitignore"
Publish these changes
git push
On your colleagues machine fetch the new configuration
git pull
Done
When your other dev gets errors on pull because of changes in her config-dev.php, she should copy her local changes away and then rename the file back after pushing:
cp config-dev.php my-config-dev.php
git checkout config-dev.php
git pull
mv my-config-dev.php config-dev.php
|
This question already has answers here:
How do I make Git forget about a file that was tracked, but is now in .gitignore?
(35 answers)
Closed 8 years ago.
I have a file config-dev.php which will be used as a dev version config.
Now, another developer wants to make his own changes in this file.
When he commits, this file is commited and my config-dev.php is overwritten by the file from my coworker.
this file is in .gitignore but it is still not working.
How do I remove this file from git index so everyone can have its own config-dev.php?
I tried git rm --cached config-dev.php but it is still not working. Should this command be executed by all the coworkers? or should I sync after git rm??
|
How to remove a file from being tracked by git? [duplicate]
|
You edited the .gitignore in both branches. Now, git is unsure of which lines in each copy are the correct ones so it is asking you to resolve them.
The lines:
<<<<<<< HEAD
public/img/ignore
=======
Are what appears in the copy of the file in master.
And
=======
public/img/profiles
public/blog
public/recommendation
>>>>>>> newfeature
in the branch newfeature
You should just have to edit the file as you would like it to appear finally. Then...
git add .gitignore
git commit
|
I have 2 branches, master and newfeature. When I want to merge newfeature into master, I used:
git checkout master
git merge newfeature
I get the error:
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.
I opened up .gitignore and it looks like a mess now with the last part of the file looking like
<<<<<<< HEAD
public/img/ignore
=======
public/img/profiles
public/blog
public/recommendation
>>>>>>> newfeature
What happened, and how should this be fixed so that I can merge the branch into master?
|
Merge conflict in .gitignore
|
I see the GitHub API V3 Repository Statuses (for github.com or for a private GitHub enterprise instance) includes:
Create a status
List statuses for a specific ref
Get the combined status for a specific ref
There is no deletion as far as I can see.
|
I have a GitHub status check generated by TeamCity, and I'm trying to delete it (not just disable it).
I've tried (line breaks added for readability):
curl -u <myusername>:<mytoken>
-X DELETE
https://:github_instance/api/v3/repos/:user/:repo/statuses/:hash
I got the url from:
curl -u <myusername>:<mytoken>
https://:github_instance/api/v3/repos/:user/:repo/statuses/:branch_name
Am I missing something?
|
How do I remove a GitHub status check?
|
36
THe "What plan should I choose?" page mentions:
GitHub provides two types of plans: free plans and paid plans.
Both plans have the exact same features. They can have any number of public repositories, with unlimited collaborators.
That being said, too much of anything will be eventually detected and reviewed by GitHub in order to check if the service isn't abused.
Update April 2020: as I explained in "Can a repository on GitHub be owned by 2 users?", "GitHub is now free for teams".
The number of public or private repo is now unlimited.
Share
Improve this answer
Follow
edited Jun 20, 2020 at 9:12
CommunityBot
111 silver badge
answered Oct 1, 2015 at 4:33
VonCVonC
1.3m539539 gold badges4.6k4.6k silver badges5.4k5.4k bronze badges
Add a comment
|
|
I was interested to know, how many public repositories can be created on GitHub for an individual account (not an organization account). Is their any limit on number of public repositories that can be created on GitHub.
|
How many public repositories can be made on GitHub for individual account?
|
There are numerous git plugins available via Package Control, so all you have to do is browse through them, read the READMEs, and decide if you want to try it out. I use SideBarGit (along with SideBarEnhancements), which allows you to right-click on a file in your project and get access to the whole array of git-related tasks, from Add & Commit & Push to Branch to Clone to Diff and more. Another popular tool is Git, which provides essentially the same options as SideBarGit, just in a menu off SideBarGit0 instead.
SideBarGit1 is a free-to-try, € 10 to buy commercial plugin (available through Package Control) that looks like it's very full-featured, allowing you to do just about anything related to git. It includes a number of syntax definitions for editing commit messages, looking at diffs, comparing branches, etc., and judging by its popularity (it's one of the Top 100 at Package Control) a lot of people seem to like it. But, it's not open-source, and costs extra money to use long-term.
Any of these will work with Github, Bitbucket, or any other public or private repo that uses the SideBarGit2 protocol. Try them out, and see what works for you.
|
I thought it would be perfect if ST would have a plugin for syncing repo with the one on GitHub account, but I can't find such a thing.
There is Github Tools and sublime-github but they don't provide commit or push commands.
I can always use GitHub's app for syncing but plugin is more convenient, since it can be assigned to ST's hotkeys.
|
How to integrate Sublime Text with GitHub?
|
You're expected to use an absolute path to a http accessible image

If you're willing to link against your own repository, you should use the raw url format.
For instance, the following markdown

should display the following image
Note: An alternate raw format is also supported. The image above can also be accessed through the following url: https://raw.github.com/libgit2/libgit2sharp/master/square-logo.png
Update
Following your comment.
The following markdown in basic_option.md won't work.
> 
Switching it to the markdown below should fix this
Indeed, you didn't use the raw url format (see above)

|
pictures can't show in github
I use markdown to write note, and when I want to add a picture, I do this:

here comes a problem, when I git push the repo, the github coouldn't recognize the
absolute path in my computer
so my question is that what the picture path is in github and markdown file?
|
github picture path
|
Rather than using an AWS service directly (as you say they nearly all expect a much more complicated setup, deploying to EC2 etc), you might be better off using a CI provider such as Shippable, Codeship or Wercker.
These all have the ability to fire from git updates, run build commands, install utilities into their CI images/containers and copy files to S3.
There's probably some startup which has built an exact tool for your purpose, but they haven't appeared on my radar yet :-)
|
Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'd like to automate deploying our site to AWS S3. I've written a node script to automate building and uploading the site, but I'd like to have the script automatically run whenever the master branch of our repo is updated on github.
I looked into AWS CodeDeploy, but it looks like that's for specifically deploying to EC2. I've also looked at AWS Lambda, but there doesn't seem to be a clear way to pull a copy of the repo using git so I can run the script.
Any services (preferably tied to AWS) that I can use?
|
Best strategy to deploy static site to s3 on github push? [closed]
|
git push assumes that you already have a remote repository defined for that branch. In this case, the default remote origin is used.
git push origin master indicates that you are pushing to a specific remote, in this case, origin.
This would only matter if you created multiple remote repositories in your code base. If you're only committing to one remote repository (in this case, just your GitHub repository), then there isn't any difference between the two.
|
This question already has answers here:
What is the difference between git push origin and git push origin master
(5 answers)
Closed 8 years ago.
After a git commit, I have two options:
git push
git push origin master
My intent is to push my changes in my local repo to GitHub master branch. In what circumstances do they make a difference?
(Also, what does "origin" here mean?)
[UPDATE]:
I think this is not a duplicate question with this post, because, on the mentioned duplicate post, the question about git push origin and in this question is about git push only.
|
What is the difference between "git push" and "git push origin master"? [duplicate]
|
A static site cannot by definition support PHP.
Static websites serve content directly from the web-server’s file-system
exactly as stored.
Dynamic websites generate content live per each request. The request is
delegated to a running web-application that builds the content.
What is a Static Website
You might be interested in PieCrust. It is a
static site generator.
|
Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Thank you for taking the time to review my request for help.
I've been using gh-pages to work on a build for a static site and the server has worked amazing for me throughout the build!
Although I seem to have an issue when submitting my HTML web form to my email through PHP code. When I submit to the gh-pages server I get this error message saying *405 not allowed ngix* I've been digging around to find an answer to this. First I discovered that I did have a few minor errors in my code which I fixed. Then I submitted again to the server with the correct code and still received the same message from the gh-pages server. *405 not allowed ngix* this leads me to believe that the gh-pages server does not support any PHP code.
I found some information on SO about the gh-pages server not supporting PHP. How to publish .php page instead of .html at github to demo some php content?
Server side includes alternative
Does PHP run on gh-pages? Or not?
If not then I know that everything on my side is correct and I should not worry about it because when I truly deploy this site live I'll use a server that does support PHP.
Here's my current build so you can test out my issue.
http://kapena.github.io/pp_web/#contact-pp
This is what I am getting when I submit the form to the server..
|
Do GitHub pages support PHP? [closed]
|
It seems you can use relative URLs for submodules. From git help submodules:
COMMANDS
add
[...]
<repository> is the URL of the new submodule’s origin repository. This may be either an absolute URL, or (if it begins with ./ or ../), the location relative to the superproject’s origin repository
So, if you follow the same naming convention in both sites (ie, github.com/you/parent-project, bitbucket.org/you/parent-project, github.com/you/child-project and bitbucket.org/you/child-project), you should be able to set the submodule like this:
[submodule "programs/mgr-nancy-demo"]
path = programs/mgr-nancy-demo
url = ../mgr-nancy-demo.git
Test it - YMMV!
|
I have git repository with two remotes (github and bitbucket). Inside I have submodule, that points accordingly to another github/bitbucket repo.
But in the definition of submodule is url, that is hardcoded. Can I have two of them? Or one per remote? So that my main repo on github points to submodule on github. And my main repo on Bitbucket points to submodule on bitbucket?
[submodule "programs/mgr-nancy-demo"]
path = programs/mgr-nancy-demo
url = [email protected]:wedkarz/mgr-nancy-demo.git
|
Multiple urls of git submodule - per remote submodules
|
To get a git history without any pull request merge commits I can use the merge button (Pull request page) and perform a rebase and merge:
|
On Github every time I merge a pull request into my base branch I get an extra merge commit:
Merge pull request #77 ...
I prefer to get a git history without these merge commits.
How can I achieve that?
|
How to merge a pull request without getting a merge commit in the Git history
|
I have managed to make the font size small in table by using <sub>...</sub> tag.
Achieved this by Wrapping each line of text (inside td) under <sub>...</sub>.
UPDATED WIKI LINK
|
I am creating a Wiki page in github.com. I am trying to use table in the Markdown edit mode. I created table by embedding html expecting to add inline-css later but found that inline-css also not working.
I tried following:
<style>
.markdown-body table td {
font-size: 12px !important;
}
</style>
Link for my wiki page.
Have anyone tried it before or achieved similar things or any help?
|
Change font in Github Flavored markdown for Table
|
After your Github repository has been created (i.e. you can view it on Github), then you should already have:
1. Local repository set up:
git init
2. README file created and added to the repository:
touch README.md
git add README.md
git commit -m 'first commit'
3. A remote called origin linked to your repository:
git remote add origin https://github.com/username/repo.git
4. An initial push, which copied your local README to your Github repository:
git push -u origin master
If you can view your repository on Github, then it has been successfully created. In this case it looks like you may have edited your README file on Github using the online editing tools, which caused your remote and local branches to diverge.
Before you can push your local changes to Github, you need to fetch or pull your remote changes, merge the changes locally (merging is automatic with pull), and then push to the remote.
See Pro Git: Fetching and Pulling from Your Remotes
|
I created a new repository on github.
I selected one of the options that added a README.md.
I then cd into the project on my hard drive.
I ran git init: Initialized empty Git repository in /Users/myusername/github/myproject/.git/
I ran "git add ." and then "git commit -m 'project files'", which responded with this:
[master (root-commit) ca52fe0] project files
981 files changed, 257939 insertions(+), 0 deletions(-)
create mode 100644 index.php
create mode 100644 license.txt
create mode 100644 readme.html
create mode 100644 wp-activate.php
...
I then ran "git remote add origin https://github.com/myusername/myproject.git"
I then ran "git push origin master"
I then ran "git status" which said nothing to commit
But I look at repo and my "my project files" commit is not there. So then I ran git pull and got this:
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
and then git push and checked again and still my commits are not on github repo. The only time I can see the commit is when I run "git log":
MacBook-myproject myusername$ git log
commit ca52fe090e6dbf1b6aa6ee51c3283efbe7549904
Author: User <myemailaddress>
Date: Sat Jun 23 19:22:05 2012 -0400
project files
I followed github directions best that I could. What am I doing wrong?
|
commits not showing up on github
|
Type: CODE is not supported yet. There is no way you can search the code using graphql right now.
Your understanding is right. Just that you are missing one piece.
The search you are doing is happening against the type: REPOSITORY.
if you replace your search with
search(query: "beef", type: REPOSITORY, first: 10) {
you will get all the repos having beef in their name.
|
I am using the GitHub's GraphQL API to search for files/code containing a particular word. A simple (contrived) example of a search which in this case is to find the term "beef" in files located in "recipes" (the repo) for "someuser" (the owner for the repo) is shown below:
{
search(query: "beef repo:someuser/recipes", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
name
}
}
}
}
}
I tried this in GitHub's GraphQL Explorer (https://developer.github.com/v4/explorer/) and receive zero results from the search which is incorrect as I can confirm that the word ("beef" in the example above) is in the files in the repo:
{
"data": {
"search": {
"repositoryCount": 0,
"edges": []
}
}
}
When I try this using GitHub's REST API (v3) via curl, I definitely get results:
curl --header 'Accept: application/vnd.github.v3.raw' https://api.github.com/search/code?q=beef+repo:someuser/recipes
... So I know that the query (REST v3 API) is valid, and my understanding is that the query string in the GraphQL (v4) API is identical to that for the REST (v3) API.
My questions are:
Am I incorrectly using the GitHub GraphQL (v4) API or am I specifying the query string improperly, or am I trying to use functionality that is not yet supported?
Is there an example of how to do this that someone can provide (or link to) that illustrates how to search code for specific words?
|
Search for code in GitHub using GraphQL (v4 API)
|
I use GitHub buttons, which you can find here
|
Is there any way to add star button to the promotional page of the repository just like there is facebook like and Google Plus' +1 button?
|
Github STAR button on repository page
|
You could remove the secret keys using the git-filter-repo tool, see this explanation in the GitHub documentation.
git-filter-repo is much preferable to the older git filter-branch.
My old, now somewhat out-of-date answer:
You could remove the secret keys from the repository using a hammer like git filter-branch. There is a nice explanation on GitHub's help pages.
|
I have a project on GitHub behind a private repository. I want to make the repo public. However, my project uses secret keys.
How can I make the project public while still protecting the "history" of those secret keys? I'm guessing I'm SOL, and should simply invalidate the keys to prevent their use.
Note that this is not the same question as
How to open-source an application that uses API keys
or
How to handle 'open-sourcing' your application, when it uses a personal API key?
As my project is already on Git, the entire source history can be easily viewed. What I suppose I could do is branch off a separate project with the API keys hidden, and make that repo public. But then users would miss out on the entire branching history, which they may be curious about (I know I would).
|
Making a Git project open source when you have secret keys
|
14
Update Jan. 2023:
GitHub Desktop improves force pushing and fetching along with many great open source contributions (Jan. 2023)
GitHub Desktop 3.1.5 improves support for force pushing and fetching through the newly added Repository menu items as well as supporting pull request notifications on forks.
Previously, a user could only force push after an action such as rebasing.
Now, when users find their branch in any diverged state, they can opt to use the force push Repository menu item.
For example, a user can force push when commits exist on the remote that they are sure they want to overwrite.
Similarly, a user may find themselves in a new local branch they are not ready to publish, yet they want to fetch to see if there are any new changes on their main branch they would want to merge in.
Instead of having to switch branches, they can use the Repository menu item to fetch those changes.
Learn more about GitHub Desktop here.
As of Nov. 2018, still no native support for a push --force in GitHub Desktop:
no mention of that feature in the Release Notes page,
no mention in the current roadmap,
issue 3580 was still pending.
That might change, considering GitHub is now displaying who did a push --force on GitHub.
Update August 2020, issue 3580 mentioned above now include this screenshot, by turtlemaster19:
Interestingly, in the Advanced preferences of GitHub Desktop (at least on Mac) there is this interesting checkbox:
Share
Improve this answer
Follow
edited Jan 27, 2023 at 19:59
answered Nov 16, 2018 at 19:08
VonCVonC
1.3m539539 gold badges4.6k4.6k silver badges5.4k5.4k bronze badges
Add a comment
|
|
Using version 1.0.4, I can't find any force push option. Is command line the only way to use force?
Can't push
and
Can't pull
|
Is there a force push option in GitHub Desktop?
|
I had the same problem and at the time for writing this answer, there is no option of removing this from Github. So removed this tag by deleting the repository from Github and recreating a new one with the same name.
⚠️ This operation will preserve only the information stored in git, not all other Github features, i.e. issues, PRs, ... If your repository has been used for a while, this might not be the right time to do this anymore.
Specific instructions:
Make sure you have cloned your repository and all your non-stale branches are saved locally.
git fetch
Delete the original repository in the Github web UI.
Create a new repository with the same name.
Push the branches you want back to the remote.
git push
|
I see this message below my repo name. Is there any way to remove it? I used template for my app for a quick start, but in current form my app doesn't look like this template, because everything changed so much. I don't see any reason why it's still there.
|
How to remove "generated from" tag?
|
Update April 2023:
Commenting on files in a pull request is now generally available (Apr. 2023)
Commenting on files (including deleted, binary, and renamed files) in a pull request is now generally available on the web and GitHub Mobile! A special thank you to everyone that provided feedback during the public beta.
API support is also now available.
See create a review comment (REST API) or addPullRequestReviewThread (GraphQL mutation) for more details on commenting on files.
A new "subject type" field is also now returned by other APIs indicating whether a comment is on a line or file.
Learn more about commenting on a pull request.
Update March 2023:
Comment on files in a pull request (public beta) (Mar. 2023)
Commenting directly on a file in a pull request (not just a specific line) is now available in public beta!
With this capability you can now comment on deleted, binary (including images), and renamed files in a pull request.
You can also comment generally about a changed code file without having to attach the comment to a specific line.
To comment on any file in a pull request, click the Comment on this file button in the header of the file (next to the Viewed checkbox):
Comments on files appear in the Files Changed and Conversation tabs and can be replied to and resolved like regular review comments.
This feature is currently in public beta, with GitHub Mobile and API support coming soon.
Join the discussion and let us know what you think!
2019: First, as illustrated in Reviewable/Reviewable issue 135, this is not possible for GitHub itself (even though it is possible for some third-party tools).
Comments are still evolving (see "Multi-line comments"), but nothing involves binaries.
The main workaround remains to leave a comment on the PR itself, (conversation tab) rather than on a non-supported file.
|
I'm reviewing a Github pull request for some new code. As can be seen in the partial screenshot below, some of the files being submitted are binary files that have been intentionally omitted by Github. The message displayed is "Binary file not shown."
I want to comment on the pull request about these files because they are being created in incorrect folders, but Github doesn't appear to have that feature for these files.
Is it possible for me to comment on Github pull requests for binary files not shown? If so, how?
I have tried bumbling around the UI, Googling, searching for this issue on the Github forum and here on SO, but to no avail. Thanks in advance.
|
How do I comment on a Github pull request for a binary file that isn't shown
|
9
You may check pastgit: git backed paste server (gist python clone)
https://github.com/mmikulicic/pastgit
Also gitpaste: (another gist clone based on Django)
https://github.com/justinvh/gitpaste
Share
Improve this answer
Follow
edited Feb 15, 2013 at 0:07
community wiki
2 revsweakish
Add a comment
|
|
gist.github.com is incredibly handy, but I'd like to be able run something similar for sharing code samples internally with other developers behind the firewall where I work, so I don't constantly need to be sanitising my code all the time, just to talk about code examples.
Does anything like this exist?
I'm not after big project management tools, just a way to make throwaway gists, and share links easily, that also happen to be git repos, just like gist.github.com
|
Is there an internal alternative to gist.github.com to run behind a firewall?
|
11
There was an extended discussion on this topic in the tidyr issues (Hadley Wickham participated, which adds a little extra credibility). The solution was to use the two-line CRAN template as LICENSE (for CRAN) and then the full MIT license in LICENSE.md and add that to .Rbuildignore (for GitHub). See the relevant pull for tidyr.
This is a similar solution to the current top answer, but it feels cleaner to me as it does not use a spelling-based "hack".
Update (January 2021): As Konrad Rudolph pointed out in the comments, GitHub will now ignore LICENSE.md if LICENSE is present.
Update (August 2022): GitHub will now detect both LICENSE.md and LICENSE and will display something like "Unknown, MIT licenses found".
Share
Improve this answer
Follow
edited Aug 18, 2022 at 14:31
answered Jan 15, 2020 at 0:20
burgerburger
5,76399 gold badges4242 silver badges6565 bronze badges
3
1
GitHub doesn’t actually support this (any longer?). GitHub defaults to a file called LICENSE, if found, and completely ignores LICENSE.md for the purpose of determining the repository license.
– Konrad Rudolph
Jan 24, 2021 at 23:14
Thanks for the update! Do you know if there is a new solution? Even usethis package which is supposed to automate this type of stuff is still using the LICENSE.md0 approach, so that does not seem promising.
– burger
Jan 25, 2021 at 16:07
1
I suspect there isn’t a solution, to be honest. The r-lib and tidyverse packages (which in many ways represent the state of the art in R packaging) all still do what your answer suggests, and in all cases GitHub fails to figure out the correct license.
– Konrad Rudolph
Jan 25, 2021 at 16:23
Add a comment
|
|
(NOTE: This question includes the word "license". But let's be clear: this question is not asking for licensing advice. It is asking how to simultaneously satisfy the file naming requirements of "software tools commonly used by programmers": Github and CRAN. This question could just as easily be about README files. The mere use of the word "license" seems to make folks trigger happy with their close votes.)
I have an R package who's code I'd like to keep on Github.
In accordance with R's requirements (see here for a note about template licenses), I have in my DESCRIPTION file the line:
License: MIT + file LICENCE
And my LICENCE file contains the MIT template, as required:
YEAR: 2017
COPYRIGHT HOLDER: Don Quixote
Github used to figure out licensing only by looking at the LICENSE file, which allowed me to keep the MIT text in LICENSE so that Github would detect it and the CRAN template in LICENCE so that CRAN would detect it. This approach used .Rbuildignore to hide the Github LICENSE from CRAN.
But now, a darkness has fallen on the land: Github looks at both LICENSE and License: MIT + file LICENCE
0. Finding them different, it abandons its attempt to determine the project's license.
As a result, it does not seem possible to use the MIT license, or other templated licenses, in a way which satisfies both CRAN and Github.
Renaming my CRAN license template file from License: MIT + file LICENCE
1 to License: MIT + file LICENCE
2 would fix the issue, but then CRAN complains about a non-standard file.
I could omit a the CRAN license template file from the git repo, but then I'm not sacrificing version control for expediency.
Is there a workaround?
|
How to satisfy both CRAN and Github license file naming requirements
|
I would like to keep secret the tex files but I would like to make available to everyone the pdf file.
You can dedicate a public repo (with a simple README in it) in order to upload and associate to said public repo an artifact (your pdf) as a GitHUb release.
Add that public repo as a submodule of your private repo: that will create a subfolder with the README in it, explaining where to find the pdf (in the release section of the public repo)
You can then, from your own private repo:
update the README (just for creating a new commit)
tag the README submodule repo (to create a tag that you will associate your release with)
upload your pdf to the public repo release, associated to the tag created.
All those steps can be scripted, using the GitHub API: here is an example (focused on the release upload part) in bash shell.
|
I'm wondering what's the best way to publically share on Github a file that's on a private repo on Github.
I would like thet every time a make a push in my private repository automatically the file is updated too.
In particular I have a .tex project: I would like to keep secret the tex files but I would like to make available to everyone the pdf file.
Note I'm aware of the existence of the gitignore option, but I don't want to use it since I want to keep track of the improvements on the tex files
|
Share publically a part of a private repo on Github
|
Note that since early December 2012, you can create new files directly from GitHub:
ProTip™: You can pre-fill the filename field using just the URL.
Typing ?filename=yournewfile.txt at the end of the URL will pre-fill the filename field with the name yournewfile.txt.
|
It is possible to directly edit files in a repository stored on GitHub through the web interface. Most of us would never do this but it has its uses.
I teach an introductory level course. I'd like to use Git and GitHub for homework distribution and collection (GitHub offers free private accounts for education). However, I can't ask completely fresh students to learn Git, at least not in the first few weeks. For the first few weeks I would like to say
"You can upload your homework by clicking on this sequence of buttons on github.com"
and then eventually teach them how to use the command line.
Ideally I'd like for them to be able to upload new files, not just edit existing ones. I can't find a way to do this though. How can I use the GitHub web interface for a similar purpose?
|
Uploading new files to a Git repository directly through the GitHub web application
|
8
Eureka! After reading this - Search based on the contents of a repository, the answer was clear! Search by README.md file content!
Use GitHub's search engine and provide a unique combination of words that appear in your README.md file. This is how I do it for my template - unfor19/terraform-multienv
in:readme sort:updated -user:unfor19 "tfmultienv"github.com/search?q=in%3Areadme+sort%3Aupdated+-user%3Aunfor19+%22%60tfmultienv%60%22&type=repositories
To get meaningful search results
Sorting with sort:updated
Filtering out my user name -user:USERNAME with -QUALIFIER.
Instead of hardcoding USERNAME you can use the keyword @me.
Share
Improve this answer
Follow
edited Sep 17, 2020 at 18:57
answered Sep 15, 2020 at 21:43
Meir GabayMeir Gabay
3,05011 gold badge2727 silver badges3737 bronze badges
2
7
Of course this generally won't work, as nothing prevents users from nuking the template's README.md and adding their own content; and people usually do.
– Sridhar Ratnakumar
Oct 11, 2020 at 0:56
5
That's the best alternative I could find. Do you have a better alternative?
– Meir Gabay
Oct 11, 2020 at 7:37
Add a comment
|
|
How can I see a list of all the child repos that have been created from my template repo on GitHub?
GitHub displays how many forks were created from a given repo at the top of the WUI, next to the "stars" and "watches." And you can display a list of links to those users' forks under the "analytics" tab.
How can I get a similar list of all the repos that were created from my template repo on GitHub?
|
How to see how many repos created from my repo template (GitHub)
|
1
The CODEOWNERS notification system can not be turned off. But you can turn off all notification from a repository from the repository settings.
Share
Improve this answer
Follow
answered May 23, 2022 at 20:49
Hm Elius Hossain HimelHm Elius Hossain Himel
2566 bronze badges
2
Dude turn off the ugly highlight and just put normal text
– claudekennilol
Oct 21, 2022 at 16:21
This seems to be true. But it sucks, because you don't get any real notifications anymore, like when someone mentions you explicitly in a comment.
– Fletch
Jan 30 at 10:11
Add a comment
|
|
Is there a way to disable email notifications to the default owners configured in a github CODEOWNERS file?
In the code owners documentation, I can only find the following:
These owners will be the default owners for everything in
the repo. Unless a later match takes precedence,
@global-owner1 and @global-owner2 will be requested for
review when someone opens a pull request.
@global-owner1 @global-owner2
While I do want to have the default code owners, I don't want an email notification being sent out to each code owner for each push, review remark, review approval, merge, etc. It's to much spam and makes it easy to overlook important notifications, e.g., when someone is explicitly added as a reviewer or mentioned in a comment.
|
github CODEOWNERS: Disable email notifications for default owners
|
The important thing to realize about git diff A B is that it only ever shows you the difference between the states of the tree between exactly two points in the commit graph - it doesn't care about the history. The .. and ... notations used for git diff have the following meanings:
So when you run git diff master feature that's not just showing you the change introduced by the commit you've marked as 2 - the output should show the exact differences between the state of the tree committed in master and the state of the tree committed in feature. If it's not showing you the earlier changes on your feature branch, perhaps you resolved conflicts from the earlier merges from master in favour of the version in master?
As cebewee says, it may be that what you want is git log -p master..feature, since ..0 does care about history. The meaning of ..1 and ..2 for ..3 are different since they select a range of commits:
Incidentally, it's often said that merging from ..4 into a topic branch is the wrong thing to do - instead you should be rebasing, or merging your topic branch into ..5 after it is complete. This keeps the meaning of the topic branch easily understood. The Git maintainer did a (somewhat difficult to understand) blog post about the philosophy of merging which discusses that.
|
I want to see the difference between the master branch and my feature branch. I have many pulls from the master to my feature branch and want to see the changes that would be added if I merged my feature into the master.
This is my situation:
-*--*--*-----*<master>
\ \ \
1--*--*--*--2--*<feature>
My problem is git diff master feature seems to only display commit number 2. How can I see the diff that a GitHub pull request would show, which I believe is all the way to commit 1?
I noticed git cherry shows me the commits I want to see the difference for.
|
'git diff' doesn't show enough
|
You have to init the git flow on your local repo.
GitFlow are local scripts on your machine and each repository has to have teh metadata (in the config) to use it.
simply run :
# launch the git flow wizard
git flow init
# Use git flow with default values
git flow init -d
And you are set to go.
|
I cloned a project and ran git checkout -b develop. When I run git flow feature start feature_name it gives me the following error:
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
can any one help me?
|
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first
|
try these commands
curl https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
chmod a+x ~/bin/repo
python3 ~/bin/repo init -u git@....
|
I have tried to repo init the source code Ubuntu build machine and it is successfully able to clone the code.
repo init -u [email protected]:xxx/xx_manifest.git -b xxx
Now I am trying repo init the source code in VM Ubuntu machine.
In between getting the error like below:
Traceback (most recent call last):
File "/xxx/.repo/repo/main.py", line 56, in <module>
from subcmds.version import Version
File "/xxx/.repo/repo/subcmds/__init__.py", line 38, in <module>
['%s' % name])
File "/xxx/.repo/repo/subcmds/upload.py", line 27, in <module>
from hooks import RepoHook
File "/xxx/.repo/repo/hooks.py", line 472
file=sys.stderr)
^
SyntaxError: invalid syntax
python version is same in build machine and vm machine 2.7.17.
|
SyntaxError: invalid syntax to repo init in the AOSP code
|
The way I solved it was by downgrading it to 1.62.1, and now it works perfectly again.
I'm on Linux, so this may not apply or work for you, but it should if all Visual Studio Code versions are the same across all OSes.
The Visual Studio Code team has confirmed that it will be fixed on 1.62.3
If you use openSUSE Tumbleweed like me, you can run the following command in the terminal to downgrade:
$ sudo zypper install --oldpackage code-1.62.1
|
A lot of us are currently having the issue where we aren't able to push changes to GitHub anymore and getting a
fatal: Authentication failed for error. This has been observed on Linux.
This is because the newest version of Visual Studio Code (1.62.2) introduced this bug.
Is there a fix for this version, or otherwise a workaround?
|
"fatal: Authentication failed for" when pushing to GitHub from Visual Studio Code (1.62.2)
|
Short version
To fix it
close Git Shell
open GitHub and let it do some post installation.
Open Git Shell again and you should be fixed.
Long version
Just to make sure I follow you, you just did this
Open Git Shell
You are prompted to update GitHub
After the update, Git Shell opens
Now it gives the error
git command could not be found. Please create an alias or add it to
your PATH.
Warning: Could not find ssh-agent.
If this is the case, do this
Close Git Shell
Now open the GitHub application (not Git Shell).
This will say something along the lines of (not sure of the exact version)
GitHub is extracting git..
Let that go through the process and after it is complete, go open Git Shell and it is fixed. Just worked for me at least.
|
This question already has answers here:
git command could not be found and could not find ssh-agent
(9 answers)
Closed 10 years ago.
After updating github, I am getting these WARNING.
git command could not be found. Please create an alias or add it to your PATH.
Warning: Could not find ssh-agent.
When I am trying any commands, I get error messages.
After searching, I found other people are facing similar problem. Here is the link. But they are suggesting to re-install github.
Is there any other solution expect re-installing github?
|
Git command could not be found. Please create an alias or add it to your PATH [duplicate]
|
Edit: Check your reflog with
git reflog
Pick the commit previous to your first rebase and replace the x with appropriate number below:
Just undo your last rebase and redo it:
git reset --hard HEAD@{x}
git rebase -i HEAD~2
..
git push -f origin master
Remove your pull request and issue a new one.
|
I wanted to squash my last 2 commits into one, so did a git rebase, in following way:
git rebase -i HEAD~2
but due to a typo, what I actually ended up pushing into origin was:
git rebase -i HEAD-3
Now, in the Github Pull Request it shows commit of some other unrelated commit. so basically, I want to remove commit 06674f0 which isn't mine, while keeping fcea5e0 in this PR.
how to fix the mess caused by simple typo?
|
Undo a Mistake made while squashing the commits in GIT
|
I don't know how to validate user @r2evans' comment above, but indeed it worked!
I already had a PAT token set, so I followed the steps in https://happygitwithr.com/credential-caching.html#credential-caching, starting at 10.2.1.1
install.packages("gitcreds")
library(gitcreds)
gitcreds_set()
I had to enter my account password (computer password), then it showed my current identification parameters.
In the console, three choices appear:
1: Keep these credentials
2: Replace these credentials
3: See the password / token
Select 2 to replace the password/token (credentials), and voilà!
Thanks for the easy fix @r2evans.
|
While pushing a commit to GitHub yesterday, I received an email from the GitHub team:
Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.
Thanks,
The GitHub Team
I don't understand a word of the help page...
I did create a more secure access token a few months ago when they first announced the change in authentification, and entered it in the terminal of my mac. I thought that would be it. My question is: how to update an Rstudio session created when token weren't necessary to match the new access-token policy?
Thanks in advance for your help,
Rosalie
|
How to update GitHub authentification token on Rstudio to match the new policy?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.