Response
stringlengths 8
2k
| Instruction
stringlengths 18
2k
| Prompt
stringlengths 14
160
|
---|---|---|
If you are asking about deleting a project from GitHub, open your project, click the "Admin" tab (or browse directly to https://github.com/username/project_name/edit) and on the bottom of the page, click "Delete This Repository". It'll ask you to confirm this, and then it's gone.
If you just want to erase a part of your repository, you need to do it to your git repository and push it to GitHub.
GitHub has written a howto about this in their FAQ. I Haven't tried this myself, so I can't guide you further, but you probably can manage this yourself here on.
In either case, this, naturally, doesn't delete any third party pulls – if someone has pulled the repository before you deleted it, it's out, without you being able to do much about it (other than trying the "pretty please"-technique).
|
Is there a way to entirely remove a directory and its history from GitHub?
|
Removing code from GitHub
|
You need to fetch the data onto your local repository on machine 2 first:
$ git fetch origin
$ git checkout origin/myNewBranch
|
I have an account on github and I use it from two different machines. On one, I created a new branch myNewBranch and switched to it. Then I did my modifications to my code, I committed and pushed to myNewBranch.
On the second machine, I can't figure out how to push to it.
$ git pull origin myNewBranch
From https://github.com/myUsername/myProject
* branch myNewBranch -> FETCH_HEAD
Already up-to-date.
[ I had already successfully pulled from it]
Then I try to switch to it, but I get an error:
$ git checkout myNewBranch
error: pathspec 'myNewBranch' did not match any file(s) known to git.
What am I missing?
|
Git: can't switch to new remote branch
|
You can branch your current work, rewind the master, then cherry-pick the latest commit back to the master:
git branch secret
git reset --hard HEAD~3
git cherry-pick secret
In pictures,
A--B--C--D--E (master)
after git branch secret:
A--B--C--D--E (master, secret)
after git reset --hard HEAD~3:
A--B (master)
\
C--D--E (secret)
after git cherry-pick secret:
A--B--E' (master)
\
C--D--E (secret)
Finally, if you git checkout secret; git rebase master, you can get:
A--B--E' (master)
\
C--D (secret)
|
On my local git repo I've got many commits, which include 'secret' connection strings :-)
I don't want this history on github when I push it there.
Essentially I want to push everything I have, but want to get rid of a whole lot of history.
Perhaps I would be better running in a branch for all my dev, then just merging back to master before committing... then the history for master will just be the commit I want.
I've tried running rebase:
git rebase –i HEAD~3
That went back 3 commits, and then I could delete a commit.
However ran into auto cherry-pick failed, and it got quite complex.
Any thoughts greatly appreciated... no big deal to can the history and start again if this gets too hard :-)
|
Git - only push up the most recent commit to github
|
Now, github provide image hosting, is not necessary to use an external service. You only need to drag&drop your imagen inside the comment box in the pull request and you are done :)
|
I want to make a GitHub pull request where the message contains screenshots. I know I can use the following markup:

But where do I upload them? Does GitHub provide this service themselves?
|
Where do I upload images used in pull request messages?
|
with 2FA you have to create a personal access token to use as a password when authenticating to GitHub on the command line with HTTPS URLs: https://help.github.com/articles/which-remote-url-should-i-use/#when-2fa-is-enabled
or you can clone with ssh https://help.github.com/articles/which-remote-url-should-i-use/#cloning-with-ssh-urls (may also be useful: https://help.github.com/articles/generating-an-ssh-key/)
|
I've clone a project on GitHub on my Raspberry Pi, create a new branch and push everything to the repository. For this I needed next commands:
git clone https://www.github.com/heinpauwelyn/my_repo
git checkout -b raspberry
git push origin raspberry
The problem I've got is that I can't push the branch to GitHub.com. I need to enter my username and password, but I can't use 2FA for that. Is this a bug in Git or GitHub and is there a way to get an authentication key and enter it?
I'll not enable the 2FA on GitHub.
|
2FA give problems when pushing to GitHub
|
56
To sync the master of your fork to the master of the original repository using GitHub Desktop:
Click on the 'current branch' tab and first select 'master' as the current branch (if it's not already selected).
Click on the 'fetch origin' button.
Click on the 'current branch' tab again and click the 'choose a branch to merge into master' button at the bottom.
*NOTE: Looking down this list, you will find 2 entries for every branch. Those that are prefixed with origin/ are the branches in your fork, and those prefixed with upstream/ are those in the original repository on GitHub.
Select upstream/master from this list, and this pull the changes down from the master repository to bring your local clone up to date.
Once you local clone has finished pulling the updates from the master repo, push these new changes to your fork, stored on GitHub, using the push origin button on GitHub desktop.
Share
Improve this answer
Follow
edited Oct 13, 2019 at 3:32
anticafe
6,82699 gold badges4545 silver badges7575 bronze badges
answered Nov 29, 2018 at 11:28
codestudentcodestudent
66155 silver badges55 bronze badges
4
1
what if I don't find anything called upstream ? I'm seeing only the local branches.
– Surjith S M
Sep 17, 2019 at 14:33
1
@SurjithSM I figured out why - if you are not logged into GitHub (e.g. only using SSH keys), upstream will not be there.
– Thibaut Barrère
May 24, 2020 at 12:12
Great answer, it´s tricky as the button Choose a branch to merge into master is hiding at the very bottom of the drop down menu, would never notice that :-)
– escalator
Jul 9, 2020 at 12:27
does this sync the wiki as well?
– Lockszmith
Oct 29, 2020 at 14:16
Add a comment
|
|
Please Read this before marking as Duplicate
I know there is a solution for CMD at https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository but i asked for GitHub Desktop, If you can't answer then dont mark as Duplicate
I am new to development, I hear about Git and GitHub learn very basics then I downloaded GitHub Desktop
After a while I found a great Open Source project I forked it and cloned the forked Repo in my Github Desktop. I improved some features in and and Synced my local Repo with my GitHub forked Repo, after that I did a Pull Request My addition was accepted and merged into original Repository.
I added so many new features and all my Pull requests were Merged.
This is where the Sad Story Starts :(
After ten days when I opened my Forked Repo on GitHub Website this is what I saw:
After this I searched web for many hours but can't find solution for GitHub Desktop I know there are tons of tutorial for CMD but I need to know how to sync with original Repo from Desktop Application of GitHub ?
I am new so SORRY if i asked something stupidish :)
Thanks
|
How to sync your forked repo with original Repo in Github Desktop
|
You need a token if you use the raw paths. Assuming that the image file is in the same repository, you can do it like this:

More on github blog
|
I'm trying to embed an image in my readme.md for display on GitHub. I've had no trouble doing this before with public repositories, in this format:

I'm now doing the same for a private repo that lives under an organization account and getting a 404. If I navigate to the image in the repo and get the raw URL, I get something like:
https://raw.github.com/account/reponame/master/myimage.png?login=jackaperkins&token=b295d913f6bf6e5cf1115755fb05e770
Is there a way to tell GitHub to embed the real authenticated URL? I figured the access to the resource would be controlled with sessions outside of the URL but apparently not.
|
Github readme image embeds in private repo?
|
2020: As detailed in Mark Z.'s answer, using an authentication (Authorization': 'Token xxxx') allows for a code search.
get /search/code
You can use:
either a dedicated command-line tool like feinoujc/gh-search-cli
ghs code --extension js "import _ from 'lodash'"
or the official GitHub CLI gh, (after a gh auth login) as show in issue 5117:
gh api --method=GET "search/code?q=filename:test+extension:yaml+org:new-org"
Or even:
gh api --method=GET search/code -f q='filename:test extension:yaml org:new-org' \
--jq '.items[] | [.repository.full_name,.path,.sha] | @tsv'
That would get a line-based, tab-separated list of fields in this order: repo name, file path, git sha. (see gh help formatting)
2014 (original answer): That seems related to the new restriction "New Validation Rule for Beta Code Search API" (Oct. 2013)
In order to support the expected volume of requests, we’re applying a new validation rule to the Code Search API. Starting today, you will need to scope your code queries to a specific set of users, organizations, or repositories.
So, the example of the API search code mentions now:
Suppose you want to find the definition of the addClass function inside get /search/code
0. Your query would look something like this:
https://api.github.com/search/code?q=addClass+in:file+language:js+repo:jquery/jquery
|
I'm trying to search for some piece of code using the GitHub API V3 given only the keyword, not limiting by user, organization, or repository.
For example, if I want to search for all pieces of code that contain the keyword "addClass", the results would be
https://github.com/search?q=addClass&type=Code&ref=searchresults without using GitHub API.
But how can I do the same thing through GitHub API? I tried https://api.github.com/search/code?q=addClass
It says "Must include at least one user, organization, or repository". How can I fix this?
|
How to search for code in GitHub with GitHub API?
|
If you want commits for all branches you need the --all argument, limit git log to ten with -10 and use --date-order to tell git log to sort the commits with respect to date.
git log -10 --all --date-order
|
I have one git repository, there are many branches many commits, I want to find the latest 10 commits, how to do this , thanks!
|
How to find the latest commits in one git repository?
|
You just need to use a little force:
git push --force origin master
--force can also be abbreviated to -f.
|
I created a git repository and updated it with some stuff. Later I created a new directory for this project and initialized new git for it. Now I want to push changes and replace the old contents in the repository. When I run git push origin master I get
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:Username/repo2.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
What can I do to solve this?
|
How to replace a git repository?
|
The title of the Pull Request can be accessed by github.event.pull_request.title
The workflow to use this would be:
on:
push:
pull_request:
types: [opened, synchronize]
print_title_of_pr:
runs-on: ubuntu-20.04
steps:
- name : Print Title of PR
run: echo The Title of your PR is ${{ github.event.pull_request.title }}
|
In GitHub I have a pull request called [WIP] Dev-123 Sample Pull Request.
I want to get this title in a GitHub Actions yaml pipeline.
In the GitHub Docs Context I can't seem to find which object I need to reference.
|
How to get the title of a Pull Request with Github Actions
|
Although I'm by no means an expert on this, it sounds like you should be using a Personal Access Token
|
I have to use the two factor authentication feature of github. That is fine. I am unable to comprehend how to use that with Eclipse.
Whenever I commit my code or perform any activity, the only prompt I get from eclipse is to enter repository, userid and password.
I have egit also installed but that does not help.
Issue arrives in both Mac and Windows OS
Does anyone out there know how to do this?
Thanks for your help in advance.
|
how to - github two factor authentication with eclipse
|
Just tested it myself.
<style>
#foo {color: red}
</style>
<p id="foo">foo</p>
<p style="color: blue">bar</p>
The above rendered to:
#foo {color: red}
<p>foo</p>
<p>bar</p>
GitHub strips style tags and attributes preventing you from changing the style on their pages. This is probably for security reasons. If you could inject css into GitHub pages, you could easily launch a phishing attack.
|
I'm writing a Github README.md file, and i have diferent tables. The contents are different, so table width is different too.
I want, at least the first column to be of fixed width, so i tried adding this before all the tables in the Markdown file:
<style>td:nth-child(odd){width:200px}</style>
Surprisingly that is working in my editor preview, but when committed to github, the text appears with the style tags stripped, and no style is applied.
My questions is if it's possible on github, and id it is, how do i do it.
|
Do <style> tags work in Markdown?
|
This is really embarrassing but the real problem was with my firewall Comodo Firewall which somehow was blocking the ssh connection from being initialized by git.
I can without any problems connect via ssh e.g. using command line or Putty but somehow Comodo was causing this weird issue.
Thanks everyone for support!
|
I am having a hard time getting Github (+Netbeans to work).
I want to use ssh with git (on Windows 7) to, e.g., commit or clone a project, but I keep getting this error message :
$ git clone [email protected]:USER/PROJECTNAME.git
error: cannot spawn C:\Program Files (x86)\Git\bin\ssh.exe: No such file or directory
fatal: unable to fork
Note: For now, my GIT_SSH environment variable is pointing to C:\Program Files (x86)\Git\bin\ssh.exe, but I have also tried C:\Program Files (x86)\Git\bin, erasing it entirely, pointing to putty's/plink's folder, and pointing to their executables, but still the same message.
When I test the connection everything works fine:
$ ssh -T [email protected]
Hi USER! You've successfully authenticated, but GitHub does not provide shell access.
What am I doing wrong? Does it make a difference if I do the git init in the directory in the first place?
EDIT:
This didn't help:
setting GIT_SSH to plink.exe and adding plink's path to PATH
**EDIT 2 **
result of command with GIT_TRACE=2
GIT_SSH0
|
"Cannot spawn ssh" when connecting to Github, but ssh -T[email protected]works?
|
You can merge branches in GitHub using a Pull Request as long as the merge doesn't create any conflicts.
To merge a pull request on GitHub:
Create a Pull Request to merge the draft branch into the
gh-pages branch.
If it can be merged online, you'll see This pull request can be automatically merged. and a Merge pull
request button.
Click the button and you'll have a chance to Cancel the merge or add a commit message and Confirm Merge.
If you choose to Confirm Merge, the Pull Request will automatically close.
For more information, visit Github's Merging a Pull Request Help page.
|
I want to clone/merge branch for my git repository inside github, for example merge updates in draft branch to gh-pages for publish.
And in some cases, I don't have access to command line for git command.
Is it possible to achieve this online ?
|
in github, can I clone/merge branch online?
|
Is it technically possible to take a public repository I own on github, and turn it private at a later date?
You cannot have private repositories unless you pay for them. Github's Plans and Pricing state that you can sign up for the free public repositories, and upgrade/downgrade your account at any time, so they almost certainly have a way to make your free public repositories private by upgrading to a paid account, or they would have a tremendously broken business model.
After reading their help files, you can indeed mark a public repository as private if you have a paid account.
You could also just delete the repository from your free account, and start hosting the repository yourself if you want to stop sharing it.
|
Can the owner of an open source Github repository later decide to close it? What about other people's contribution to that project?
Edit - several people focused only on the legal aspects. Besides them there exists the technical question: Is it technically possible to take a public repository I own on Github, and turn it private at a later date? Assuming nobody created a public forked from it, will this in effect hide the source code for this project?
|
Can open source code hosted at github be closed-source?
|
If master doesn't exist, then after this line
git checkout -b master origin/master
master will be a branch pointing to the same commit as origin/master.
If you already have a master branch, it might be out of date with origin/master, so simply writing
git checkout master
isn't quite enough. You'll also want to run
git merge origin/master
afterward to bring master up to date (typically this will just be a fast forward).
|
When I'm merging two branches and they can't be merged automatically Github provides these instructions:
Step 1: From your project repository, bring in the changes and test.
git fetch origin
git checkout -b master origin/master
git merge develop
Step 2: Merge the changes and update on GitHub.
git checkout develop
git merge --no-ff master
git push origin develop
But, in this case, the branch master already exists locally, and the line git checkout -b master origin/master returns this message:
git checkout -b master origin/master
fatal: A branch named 'master' already exists.
Is the correct thing to do in this case to replace that line with git checkout master? I've wondered this for a while, bit worried about what git checkout master might do as opposed to with -b.
|
Git checkout -b, branch already exists
|
the procedure should be the below:
pull the file
edit it
commit it(it commits to your local repository)
pull it again (if there are any conflict you will Be notified) in that case you can solve it executing the below command(GitBash on your repository working folder):
git mergetool
it will run the merging tool you got configured in your .gitconfig file
after that you can push your changes
|
This question already has an answer here:
Closed 12 years ago.
Possible Duplicate:
How git works when two peers push changes to same remote simultaneously
I'm kinda new to git and me and a friend want to do some collaborative developing with git. I got the whole pull and push system down somewhat, now I have a question.
I want to work on file test.php and I pull for new changes. Nothing. I edit it and want to push it, but in this time my friend edited and pushed it. What happens now? How are these conflicts solved?
Thank you!
|
Two people working on a file at the same time in git [duplicate]
|
No. The correct workflow would be forking the upstream project on GitHub to your own namespace. Then use your fork as upstream in your GitLab repository not the origin of your fork.
From your GitLab repository you are then pushing changes to your fork (upstream). Then on GitHub you can submit a pull request from your GitHub fork to the origin.
|
Most of our work occurs on GitLab.com (i.e. not a local GitLab installation). If the upstream repo resides on GitHub, is there a way to submit a pull request to upstream? (If forking the upstream repo in a particular way is part of solution, that's ok.)
|
Can I submit a pull request from GitLab.com to GitHub?
|
branch-99 does not exist on the remote repository. You probably misspelled the branch name or the repository.
To check which branches exist, use ls-remote. You can use it on the remote...
git ls-remote --heads origin
Or if you haven't already cloned the repository, on a URL.
git ls-remote --heads [email protected]:Christoffer/admin.git
You'll get the commit IDs and branch names, but they'll be full references like refs/heads/<branch>.
8c2ac78ceba9c5265daeab1519b84664127c0e7d refs/heads/fix/that
6bc88ec7c9c7ce680f8d69ced2e09f18c1747393 refs/heads/master
83f062226716bb9cebf10779834db1ace5578c50 refs/heads/branch-42
See gitrevisions for more.
To be clear, git clone -b branch-99 [email protected]:Christoffer/admin.git clones the entire repository. It just checks out branch-99 rather than master. It's the same as...
ls-remote0
That bit of syntax sugar isn't worth the bother. I guess it might save you a tiny bit of time not having to checkout master.
If you want to clone just the history of one branch to save some network and disk space use ls-remote1.
ls-remote2
However it's usually not worth the trouble. Git is very disk and network efficient. And the whole history of that branch has to be cloned which usually includes most of the repository anyway.
|
This question already has answers here:
How do I clone a single branch in Git?
(27 answers)
Closed 8 years ago.
How can I clone a branch from git with a specific Branch name?
I have a branch named branch-99 and my user name is Istiak.
I try to clone my branch like:
git clone -b branch-99 [email protected]/admin.git
I am receiving this error.
fatal: Remote branch branch-99 not found in upstream origin
What I am doing wrong here?
|
Cloning a branch : Remote branch branch-99 not found in upstream origin [duplicate]
|
Create a new branch based on upstream/master
cherry-pick the relevant commits from your branch Topic2 (into the new branch)
Create a pull request from this new branch.
|
Let's say I have cloned repository, created new branch "Topic1", made changes, commited them and then pushed them to a remote repo git push origin Topic1. After that I made a pull request into master branch.
Then on my local repository I checkout from branch "Topic1" to branch "Topic2", made some changes there, commited and again pushed this new branch to remote. And again made a pull request into master. I want to mention that in the meantime no changes were made to master branch, so I didn't need to sync my local repo with upstream.
And here's the problem: when I go to pull request page of "Topic2" all the commits of "Topic1" are presented there. So, my question - how can I get in 2nd pull request commits related only to "Topic2" branch?
|
Include only specific commits in a pull request
|
By default, GitHub Pages helps you generate html pages only.
But if you setup your site to use jekyll, then you can store files in markdown. For example, in the _posts section of this repo 'cboettig/labnotebook' which is generated to carlboettiger.info.
See Help page "Using Jekyll with Pages"
More specifically (as highlighted in esfandia's answer), see "The Automatic Page Generator", which allows for markdown editing.
As commented by dregad, there is a new theme chooser in Dec. 2016:
See this article by Antriksh Yadav:
Update August 2016: Simpler GitHub Pages publishing now allows to keep your page files in a subfolder of the same branch (no more gh-pages needed):
So you don't need multiple branch anymore.
|
I'm not too comfortable with touching the generated HTML that the site gives, I was wondering whether there is any way to change the contents of my page in markdown formatting, the same way that I did upon creating the page?
Any input as to go about doing this would be awesome.
|
GitHub Pages: How do I edit this page in markdown format, just as I created it?
|
You need to add and commit the png file to your local repo first. Then push the updates to the remote server.
git add xxx.png
git commit -m 'add png file'
git remote add origin https://github.com/xxx.git
git push -u origin master
|
I'm a newbie to Git or GitHub, and didn't find how to upload an image file into my repo in Git? Any idea?
|
How to upload images like png into GitHub repository?
|
To see how to make this work, have a look at a working example, such as:
https://github.com/sonatype/sonatype-aether
However, this won't help if you like to release the individual pieces. In that case, you have to just copy the <scm> elements into all the poms.
This is an active topic of discussion on the maven dev list, but don't hold your breath for a solution from there; it's a big deal.
|
I'm trying to release a multi-module maven project that uses git as the SCM, and among the first problems I've encountered is the way in which the maven release plugin builds the release.properties scm.url. My parent POM looks something like this:
<packaging>pom</packaging>
<groupId>org.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scm>
<connection>scm:git:git://github.com/username/project.git</connection>
<developerConnection>scm:git:[email protected]:username/project.git</developerConnection>
<url>http://github.com/username/project</url>
</scm>
<modules>
<module>api</module>
<module>spi</module>
</modules>
And the module POMs are straightforward:
<parent>
<groupId>org.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>api</artifactId>
<version>0.2.2</version>
My goal is to be able to release individual modules since they each have different versions and I don't want to increment all of the versions together each time I do a release.
When I change to the api directory and do a mvn release:clean release:prepare I'm met with the following output:
[INFO] Executing: cmd.exe /X /C "git push [email protected]:username/project.git/api master:master"
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The git-push command failed.
Command output:
ERROR: Repository not found.
It looks like the maven release plugin creates the scm.url by appending the module name to the developerConnection, which ends up not being a valid repository at github. I'm not sure what the right way to set this up is. It might be the case that Maven + git + releasing an individual child module simply won't work? Any input is appreciated.
|
Releasing a multi-module maven project with Git
|
Use $ git config --global core.askPass ""
You can also set credentials in your config to prevent being prompted every time (https://git-scm.com/docs/gitcredentials).
|
I don't know why, recently git shell asks me for credentials in an old-fashioned OpenSSH window (by the way, I use a https connection) instead of just prompting in the console.
That prevents me to use the wincred, I always have to type my credentials. Quite annoying, esecially that when I make a typo, the console cursor disappears. How can I go back to the default mode?
System: Windows 7
Console: ConEmu
Thanks for help!
|
Git shell prompts for password in an OpenSSH popup window
|
16
I've used all, and now I am using github and I am completely satisfied. Sourceforge had annoying ads and was slow, google code didn't have the features I wanted/needed.
As for moving to github, they have a guide here, the process should be quite simple:
http://help.github.com/svn-importing/
Share
Improve this answer
Follow
answered Jun 23, 2010 at 21:24
houbysofthoubysoft
32.8k2424 gold badges104104 silver badges157157 bronze badges
0
Add a comment
|
|
We have a fairly large project, and I've decided that Google Code is not quite living up to expectations. Github looks like a much more suitable platform -- but I feel like there's no escape for us. Is it a case of migrating stuff over manually? We're using svn currently, so I understand that we'll need to move to git somehow - is this going to be possible considering that I don't have admin access to our repository? Also, I know this is subjective and I don't want to start a holy war, but please also comment on your feelings about Google Code vs Github. Should we also be considering SourceForge?
|
Is it possible to somehow migrate from Google Code to Github?
|
8
you can try this in your actions
- name: Send mail
if: failure()
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: [email protected],[email protected]
# from email name
from: XYZ
Share
Improve this answer
Follow
edited Mar 15, 2022 at 19:41
Benny Code
53k2929 gold badges240240 silver badges201201 bronze badges
answered Apr 26, 2021 at 11:02
Kalyan RaparthiKalyan Raparthi
39533 silver badges1212 bronze badges
1
2
if: always() this looks like it will run on every execution of the action, not just on failure, which is what OP requested
– mgalgs
Jul 12, 2021 at 19:22
Add a comment
|
|
We have a scheduled github action that fails sometimes. How can I receive email notifications if it fails. At the moment, only the creator of the workflow receives email notifications when it fails.
|
github actions: notifications on workflow failure
|
84
I know this question is a year old now and asking about the create-pull-request action, but for those that would rather not use third-party actions, Github actions now support Github command line natively, if you use Github hosted runners. See: Using Github CLI in Workflows
This makes it super easy to create a pull request using the gh pr create command
Something like this:
steps:
- name: create pull request
run: gh pr create -B base_branch -H branch_to_merge --title 'Merge branch_to_merge into base_branch' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Share
Improve this answer
Follow
edited Dec 20, 2022 at 21:00
Michael Heil
17.2k44 gold badges4848 silver badges8585 bronze badges
answered Aug 12, 2022 at 22:28
Scott RobeyScott Robey
1,2931010 silver badges88 bronze badges
2
20
Make sure you also enable Allow GitHub Actions to create and approve pull requests under Settings > Actions in your repository
– FWDekker
Feb 28, 2023 at 18:16
You saved my day.
– Bob
Oct 25, 2023 at 15:06
Add a comment
|
|
I'm trying to make it work this action, but I'm confused also whats it's missing in between, before triggering the peter-evans PR.
The scenario is pretty simple, I like on push, on any feature/* branch, to create automatically PR, but instead I'm getting weird scenario, where develop changes are applied on top of the feature/* branch. Can someone give me hints on this?
name: Pull Request Action
on:
push:
branches:
- feature/*
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: develop
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Simple demo
title: '[Example] Simple demo'
body: >
This PR is auto-generated by
[create-pull-request](https://github.com/peter-evans/create-pull-request).
labels: feature, automated pr
branch: feature/workflow-demo
|
Create pull request with github action
|
Firstly, some git commands to fetch version information:
commit hash long
git log --pretty="%H" -n1 HEAD
commit hash short
git log --pretty="%h" -n1 HEAD
commit date
git log --pretty="%ci" -n1 HEAD
tag
git describe --tags --abbrev=0
tag long with hash
git describe --tags
Secondly, use exec() combined with the git commands of your choice from above to build the version identifier:
class ApplicationVersion
{
const MAJOR = 1;
const MINOR = 2;
const PATCH = 3;
public static function get()
{
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
$commitDate = new \DateTime(trim(exec('git log -n1 --pretty=%ci HEAD')));
$commitDate->setTimezone(new \DateTimeZone('UTC'));
return sprintf('v%s.%s.%s-dev.%s (%s)', self::MAJOR, self::MINOR, self::PATCH, $commitHash, $commitDate->format('Y-m-d H:i:s'));
}
}
// Usage: echo 'MyApplication ' . ApplicationVersion::get();
// MyApplication v1.2.3-dev.b576fd7 (2016-11-02 14:11:22)
Please note that on a production system, PHP's exec is often in the list of disabled_functions, and git log --pretty="%H" -n1 HEAD0 may not be available. The code from above might then become part of your build scripts. This enables you to versionize the application during the build stage (e.g., on a development container with git log --pretty="%H" -n1 HEAD1 and PHP's git log --pretty="%H" -n1 HEAD2) and deploy it with static version strings to production.
|
I want to display the Git version on my site.
How can I display a semantic version number from Git, that non-technical users of a site can easily reference when raising issues?
|
Display the current Git 'version' in PHP
|
add the following line to your .gitignore:
!iceberg/static/icon
The bang (!) character in a .gitignore file means to not ignore the specified path.
|
I tried to add a folder iceberg/static/icon into my repo but this fails with error:
shen-3:New Platform shen$ git add iceberg/static/icon
The following paths are ignored by one of your .gitignore files:
iceberg/static/icon
This is my .gitignore. I am really confused that I don't understand which item matches my file.
hello/
deploy_server/
gunicorn_start
Vida.env/
# IDE conf
.idea/
.vscode/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
staticfiles/
local_settings.py
migrations/
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
Is there any other reason this happens?
Any insight into why my folder isn't being added would be appreciated! :)
Thank you!
Full url you want /Users/shen/Desktop/New Platform/iceberg/static/icon
|
The following paths are ignored by one of your .gitignore files
|
It is an Eclipse bug. I have faced the similar problem several times. closing and reopening the project works sometime. if it doesn't work try restarting Eclipse.
|
Before coming to the problem let me explain what I did that has landed me in the problem.
I created an account on github and made a repository named Android.
Then I installed github client in my windows 7.
Then I opened this client, provided my authentication and cloned the repository to a local directory C:\Users\Aniket\Documents\GitHub\Android(This folder has the .git folder in it).
Then I went to my Eclipse ADT and installed EGit plugin as described here. Also I
Then in Eclipse I right click on my project TicTacToe go to Team->Share Project and provide my repository path i.e C:\Users\Aniket\Documents\GitHub\Android.
My Project was added to the local repository and in my github client it shows me all option to commit file in the actual repository on the github site.
But my project is suddenly showing error with a red '!' sign on it.
Description --> Archive for required library: 'C:/Users/Aniket/AndroidWorkspace/TicTacToe
/libs/android-support-v4.jar' in project 'TicTacToe' cannot be read or is not a valid ZIP file
Resource --> TicTacToe
Path Location --> Build path
Type --> Build Path Problem
Note : the Error was a single line displayed in error console on Eclipse. I just split it up for readability.
Even after detaching repository it shows that error.
Has anyone encountered this scenario before. What is the solution or workaround? I googled and first few links suggest it is an Eclipse bug. Please suggest what can be done to bring my project back to executable state?
|
archive for required library could not be read or is not a valid ZIP file
|
You don't have any local branch called develop. When doing git checkout develop and no local branches are found, git will understand that you want to make a new local branch called develop, based on a develop branch in a remote repo, if any exists. In your case, you have 2 such branches origin/develop and pateketrueke/develop, so there is an ambiguity.
You can be more explicit about it by using the following form:
git branch develop origin/develop
git checkout develop
or
git branch develop pateketrueke/develop
git checkout develop
depending on what you want.
These can be abbreviated as:
git checkout -b develop origin/develop
or
git checkout -b develop pateketrueke/develop
|
I'm in a github local clone. Below is the list of branches:
$ git branch -a
* master
online-demo
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/gh-pages
remotes/origin/master
remotes/origin/online-demo
remotes/pateketrueke/develop
remotes/pateketrueke/gh-pages
remotes/pateketrueke/master
When I try to checkout a remote branch, I get an error:
$ git checkout develop
error: pathspec 'develop' did not match any file(s) known to git.
I can't figure out where does that come from. I guess I've been doing such checkouts for ages. Maybe I'm missing something. Anyway, I did git fetch, git fetch origin and git pull because I'm running out of ideas and there's still the same error.
|
cannot checkout remote git branch
|
40
Here are the commands:
git branch –D branch-name (delete from local)
git push origin :branch-name (delete from stash)
Note the colon (:) in the last command.
Share
Improve this answer
Follow
edited Aug 5, 2015 at 17:12
Jess
24.4k2121 gold badges126126 silver badges149149 bronze badges
answered Oct 14, 2013 at 15:25
PraveenPraveen
1,79233 gold badges2828 silver badges4444 bronze badges
3
git push origin has nothing to do with what git calls a "stash", but rather with what git calls a "remote". So it sounds like your question was actually about deleting a branch on a "remote". See How do I delete a git branch both locally and remote?.
– torek
Oct 14, 2013 at 16:20
6
As per the comments above, I believe the question is about the Atlassian product 'Stash' which is a Git hosting solution. The question should probably be renamed to "How to remove branch from a remote (on Atlassian Stash)"
– Lee Campbell
Jan 29, 2014 at 12:30
2
In the UI the option appeared in 2.1 for merged branches and in 2.8 in general: jira.atlassian.com/browse/STASH-3347 and jira.atlassian.com/browse/STASH-2753
– LAFK says reinstate Monica
Feb 18, 2014 at 18:28
Add a comment
|
|
I want to delete a branch from Atlassian Stash (a sort of github clone) in order to revert my changes. Please let me know what command will do this?
What I know is git branch –D prod-652 deletes the branch from local. How can I delete it from Atlassian Stash?
|
How to remove branch from a remote (on Atlassian Stash/Bitbucket)
|
As per the docs:
Resolving lockfile conflicts
Occasionally, two separate npm install will create package locks that
cause merge conflicts in source control systems. As of [email protected],
these conflicts can be resolved by manually fixing any package.json
conflicts, and then running npm install [--package-lock-only] again.
npm will automatically resolve any conflicts for you and write a
merged package lock that includes all the dependencies from both
branches in a reasonable tree. If --package-lock-only is provided,
it will do this without also modifying your local node_modules/.
To make this process seamless on git, consider installing
npm-merge-driver, which will
teach git how to do this itself without any user interaction. In
short: $ npx npm-merge-driver install -g will let you do this, and
even works with pre-[email protected] versions of npm 5, albeit a bit more
noisily. Note that if package.json itself conflicts, you will have
to resolve that by hand and run npm install manually, even with the
merge driver.
|
git merge --no-ff account-creation
Auto-merging package-lock.json
CONFLICT (content): Merge conflict in package-lock.json
Automatic merge failed; fix conflicts and then commit the result.
Any idea regarding this issue ?
|
Auto-merging package-lock.json
|
As the description (located at http://developer.github.com/v3/repos/contents/) says:
/repos/:owner/:repo/contents/:path
An ajax code will be:
$.ajax({
url: readme_uri,
dataType: 'jsonp',
success: function(results)
{
var content = results.data.content;
});
Replace the readme_uri by the proper /repos/:owner/:repo/contents/:path.
|
I need to get the contents of a file hosted in a GitHub repo. I'd prefer to get a JSON response with metadata along with it. I've tried numerous URLs with cURL with to only get a response of {"message":"Not Found"}. I just need the URL structure. If it matters, it's from an organization on GitHub. Here's what I think should work but doesn't:
http://api.github.com/repos/<organization>/<repository>/git/branches/<branch>/<file>
|
How to get a file via GitHub APIs
|
There is no way to undo. The quota is monthly, so you just have to wait for quota reset.
Github Actions (runner time) and Github Storage (artifacts) should have separate quotas.
For Github Actions, I know they are free for public repositories, so you could change your repository visibility, at least temporarily if you need it. As for Github Storage, I'm not sure if the same trick works, never tested.
Let me know and I can update the answer.
|
I have a GitHub workflow that creates APKs for my Flutter app. This worked fine until recently, I seem to have exhausted some kind of quota. Now when the workflow runs I get this error:
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
I assumed that deleting all artifacts would free up the space again so I used another workflow to achieve this:
name: 'Delete old artifacts'
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
delete-artifacts:
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 0days
The new workflow seems to be working, I no longer see the old files in the GitHub UI. However, I still get the error when trying to run the APK workflow. Any ideas how to fix this error?
Update:
My GitHub says I have used up my included services (free version). Is there a way to undo that? Simply deleting the artifacts does not seem to be enough.
|
[GitHub Actions]: Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
|
It looks like your script is pulling the last part of the remote URL and using that as the project name. This works when using a single remote site, such as http://bitbucket.org but your system will not work universally across all users of that repository.
Users generally all have different remote repositories, in fact on many projects you will have multiple remotes. Git does not care where a repository comes from when fetching and merging. The merge algorithm will even accept branches with no common ancestor.
The only real solution is to create a text file in the root of each repository that contains the project name. This solution will work across all users, regardless of how they setup their remotes.
|
Does git have a built-in command for showing the name of the current remote project? Right now I'm using this:
git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//'
...but it seems like there would be a built-in equivalent.
|
Is there a git command that returns the current project name?
|
I found it... now we need to right-click precisely on the "X changes" text in blue:
On GitHub Desktop for Mac v2.17: Menu Bar > Repository > Discard Changes to Selected Files.
Related issues:
Undo Discard Changes #861
Allow discarding of individual lines in a file #2402
|
How can I discard all changes at once in GitHub Desktop? (I use it on Windows)
I used to do:
but can't see the option any more since GitHub for Windows upgraded itself silently (and changed its name to GitHub Desktop on the way).
I don't want to do it manually for each file one by one. I know I can use the git shell.
I use the latest version of GitHub Desktop, viz. 3.0.1.1.
|
Discard all changes at once using GitHub Desktop
|
47
To resolve this issue, do the followings
login to your GitHub account
go to https://github.com/settings/tokens
click on "Generate new token"
make necessary selections (but must select repo)
click on "save"
System will have a token
use this token instead of a password in the eclipse or other tools you are using
Now push your code from Github and it will work.
Thanks
Share
Improve this answer
Follow
answered Aug 18, 2021 at 20:25
B BanikB Banik
47544 silver badges33 bronze badges
1
2
As of August 13, 2021, you no longer have the option of using a password, as per github notice: "Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com" You can read more about this here: github.blog/…
– chars
Jan 19, 2022 at 22:04
Add a comment
|
|
Hi,
I am facing the issue 'Can't connect to any URI:....' while committing code to Github from Eclipse. I have also generated SSH keys for my machine and added to the Github account. Please help me out...
Thanks!
|
Can't connect to any URI error while commiting code from Eclipse to Git Repository
|
64
Copied from this answer
https://stackoverflow.com/a/10729634/1095114
If this is an issue with your firewall blocking the git: protocol port (9418), then you should make a more persistent change so you don't have to remember to issue commands suggested by other posts for every git repo. This also just works for submodules that might be using the git:// protocol too.
Simply issue the following command:
git config --global url."https://".insteadOf git://
This simply adds the following two lines to ~/.gitconfig:
[url "https://"]
insteadOf = git://
Now, as if by magic, all git commands will perform a substitution of git:// to https://
Share
Improve this answer
Follow
edited May 23, 2017 at 12:18
CommunityBot
111 silver badge
answered Apr 9, 2013 at 13:38
NoahNoah
34.1k55 gold badges3838 silver badges3333 bronze badges
1
I've also had issues where my gitconfig file wasn't being picked up because my home directory was mounted. Running 'git config --list --show-origin' in git v2.8 and above helped me find all the config files and make sure they had the same variables set.
– Ebsan
Nov 8, 2016 at 15:58
Add a comment
|
|
We are connected through a proxy and here, git is blocked ( not the website but on git//: ) we tried with egit, "git on windows", with and without proxy but not a single clone to local happened.
Now the problem is to install npm modules, I tried by downloading modules(zip) from git website (over web) and tried the local install, which worked but the problem here is huge number of dependencies, it is not easy to pull modules one by one to fill dependencies (and inner dependencies).
So how to solve this problem, I feel there can be three ways to find solution:
Allowing git tunneling through firewall (i have no friends in n/w team ).
Suggest me some way to pull modules with dependencies over http:// (and not git://) when doing npm install.
Download from git website modules + full dependencies, in single shot.
|
git is blocked, how to install npm modules
|
45
Here's what I did and this worked fine:
Right click your project, choose Team→Show in Repositories View. You will switch perspectives and be in the Git Repositories tab.
Right-click "Remotes" and choose "Create Remote". For "Remote name", enter "origin". Click OK.
Click Change. Enter your information as you did during your initial push. Click Save.
You should now be able to push by merely right-clicking on your project, then Team→Push to Upstream.
Because the remote was added under the project in question, each project can have its own upstream origin and they will not interfere (whereas the Window > Preferences solution is a global setting).
Based on your description of what you did, it appears you attempted this - but possibly did not use the name "origin" for the remote, which is absolutely necessary. I stumbled across this solution by pure chance.
Share
Improve this answer
Follow
edited May 19, 2012 at 3:56
answered May 19, 2012 at 3:37
Chiara CoetzeeChiara Coetzee
4,26111 gold badge2424 silver badges2020 bronze badges
3
4
this also works to setup for Pulling! just choose "Configure fetch" after step 2, then click "ok", then go to step 3.
– Adriano
Nov 19, 2012 at 18:00
1
Thank you Derrick for saving me from this headache! :) Worked perfectly!
– Vincy
Oct 8, 2013 at 10:51
1
This solution is the equivalent to how most "Team -> Share Project..." flows work with other source controls. It would be nice if EGit allowed you to share to a remote repository upon sharing the project, but it is instead a two step process - 1. Share project and create a new local repository, 2. configure the remote for the local repository. I guess that is just how Git works.
– Michael Plautz
Jul 6, 2015 at 21:19
Add a comment
|
|
I created a repository on GitHub. I set up a local git repository using Eclipse and Egit.
With Team > Remote > Push. I managed to push the local repo to the one on GitHub.
Now I expected to be able to use the Team > Push to Upstream (as well as fetch from upstream) as a one-click push (and pull/fetch), but this menu choice is not available (grayed out). I have to use Team > Remote > Push to each time manually fill in the info (ctrl+space helps).
Following this, I created a remote configuration and pushed from the repositories view, and I can see the remote GitHub repository listed under Remotes but still the Team > Push to Upstream command is grayed out in the menu.
Could someone please give me a hint as to what I have may done wrong?
|
Eclipse/Egit, Push to Remote menu choice is grayed out
|
37
Yes, you can use stash.
git stash -m "optional description here"
It will save any uncommitted stuff in a special area where you can get it back later using
git stash apply
You can see what is in the stash with
git stash list
Share
Improve this answer
Follow
edited Aug 5, 2023 at 11:03
dan1st is crying
14.3k1212 gold badges3939 silver badges7777 bronze badges
answered Jul 27, 2017 at 13:30
Dan LoweDan Lowe
53.6k2020 gold badges128128 silver badges113113 bronze badges
Add a comment
|
|
I am working on one branch, and suddenly I have to switch to another branch to fix an urgent bug. The problem is the changes I make to the current branch is still a mess and I do not want to commit that and leave some scrappy commit message.
Is there any way I can save the current changes without commit?
|
How to switch and save without commit in git?
|
Considering the GitHub API for Users doesn't yet expose that particular information (number of days for current stream of contributions), you might have to:
scrape it (extract it by reading the user's GitHub page)
As klamping mentions in his answer (upvoted), the url to scrap would be:
https://github.com/users/<username>/contributions_calendar_data
https://github.com/users/<username>/contributions
(for public repos only, though)
SherlockStd has an updated (May 2017) parsing code below:
https://github-stats.com/api/user/streak/current/:username
try projects which are using https://github.com/users/<username>/contributions_calendar_data (as listed in Marques Johansson's answer, upvoted)
IonicaBizau/git-stats:
akerl/githubchart (Github contribution SVG generator)
akerl/githubstats (Github contribution statistics)
build that graph yourself: see the GitHub project git-cal
git-cal is a simple script to view commits calendar (similar to GitHub contributions calendar) on command line.
Each block in the graph corresponds to a day and is shaded with one of the 5 possible colors, each representing relative number of commits on that day.
or establish a service that will report, each day, any new commit for that given day to a Google Calendar (using the Google Calendar API through a project like nf/streak).
You can then read that information and report it in your blog.
You can find various example of scraping that information:
github_team_calendar.py
weekend-commits.js
As in:
$.getJSON('https://github.com/users/' + location.pathname.replace(/\//g, '') + '/contributions_calendar_data', weekendWork);
leaderboard.rb:
Like:
https://github.com/users/<username>/contributions0
... (you get the idea)
|
I have a personal blog I built using rails. I want to add a section to my site that displays my current streak of github contributions. What would be the best way about doing this?
edit: for clarification, here is what I want:
just the number of days is all that is necessary for me.
|
How can I add "current streak" of contributions from github to my blog?
|
As rlb.usa noted, Github has added a file size limit that prevents you from pushing files > 100MB. You tried to remove the file in a new commit and tried to push that. That fails, because you are not just pushing that last commit, but also three others. Those three commits contain versions of cron_log that are 141MB and 126MB in size. They cause your push to fail.
To fix that, you have two options:
Run git rebase -i origin/master, set every commit to edit and remove the file in each with git commit --amend.
Use the BFG Repo-Cleaner to clean all your history.
|
How does this change as of June 18, 2013 affect my existing repository with a file that exceeds that limit? I last pushed 2 months ago with a large file.
I have a large file that I have removed locally but I can not push anything now. I get a "remote error" ... remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB
I added the file to .gitignore after original push... But it still exists on remote (origin)
Removing it locally should get rid of it at origin(Github) right? ... but ... it is not letting me push because there is a file on Github that exceeds the limit...
https://github.com/blog/1533-new-file-size-limits
These are the commands I issued plus error messages..
git add .
git commit -m "delete cron_log.log"
git push origin master
remote: Error code: 40bef1f6653fd2410fb2ab40242bc879
remote: warning: Error GH413: Large files detected.
remote: warning: See http://git.io/iEPt8g for more information.
remote: error: File cron_log.log is 141.41 MB; this exceeds GitHub's file size limit of 100 MB
remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB
To https://github.com/slinds(omited_here)/linexxxx(omited_here).git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/slinds(omited_here)
I then tried things like
git rm cron_log.log
git rm --cached cron_log.log
Same error.
|
Github file size limit changed 6/18/13. Can't push now
|
Have you checked what e-mail address is associated with the commit message? I believe GitHub only attributes commits to you if the e-mail address associated with the commit is also connected to your GitHub account...
See GitHub's cheat sheet for information about how to add e-mails to your git config:
git config --global user.email "[email protected]"
If you type:
git config --list
you'll see all your current git configuration settings.
|
I have two repositories on github, and my usernames on github and my local git name match. But for some reason github does not attribut my commits to me - so in statistics, there are no commits by the owner, only by some user with the same name. What could cause such behaviour?
|
Why github does not recognize my username in my commits?
|
I am using Mac OS X 10.7.5. I recently downloaded git 1.8.1.2 for Mac. Having it installed, I bumped into the same signal 11 error message when running:
$git credential-osxkeychain
which in turn runs:
/usr/local/git/bin/git-credential-osxkeychain
Signal 11 is SEGFAULT which might indicate a bug (e.g. dereferencing a null pointer) with the git-credential-osxkeychain program.
I followed instructions on caching your github password and grabbed a new copy of git-credential-osxkeychain from S3. That resolved the problem. The new copy is of different size which makes me guess the bug has been patched.
In the meantime, I believe using a URL like [email protected]:yang3wei/octopress-3-in-one in the config should also work around the problem as it bypasses HTTPS and uses SSH instead where the key chain helper is not invoked any more.
|
I have installed github version 0.8.4,
but when i try to fetch something from git, it is showing this message.
Fetching all tracking branches from Queue-iOS completed successfully.
command: git fetch Queue-iOS
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
From https://github.com/appstute/Queue-iOS
59bb075..b2da838 master -> Queue-iOS/master
It is a problem regarding keychain,
when i go for pull from git hub, the following message is displayed
Pulling all tracking branches from Queue-iOS encountered an error.
command: git pull Queue-iOS
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
You asked to pull from the remote 'Queue-iOS', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
error = 1
Here Queue-iOS is the local folder I have configured on git. Please help.
|
error: git-credential-osxkeychain died of signal 11
|
You can use GitHub Docs' GraphQL API Explorer to run a mergeBranch mutation:
mutation {
mergeBranch(
input: {
repositoryId: "MDEwOlJlcG9zaXRvcwNzI="
base: "master"
head: "cool_feature"
commitMessage: "Shipped cool_feature!"
}
) {
clientMutationId
mergeCommit {
oid
message
}
}
}
Note: You can look up your repository's id by using the repository query to search by owner and name.
{
repository(owner: "my-name", name: "my-repo") {
id
}
}
|
It looks like GitHub only allows merging of branches by making a pull request and then merging.
Is there a way to merge mobile into main in a single step without cloning locally?
I only see this button, which creates a pull request that needs to be merged in a second step:
|
How to merge branches on github.com without doing pull request?
|
It sounds like you're looking for https://github.com/issues/assigned.
The easiest way to get there is to click on the Issues link at the top right of the GitHub UI, and then the Assigned tab at the left side of the screen:
You can also use the assignee key in the search bar manually, e.g. assignee:panthro.
|
I've checked the GitHub docs but can't find this. I've also googled this but can't find an answer.
How can I see all issues for all my repositories that have been assigned to me on the GitHub website?
|
View issues that are assigned to me?
|
But why? If you have a commit, it means you already have those changes applied to your files. Some, files might have been changed since the commit, but then, if you try to get a stash of that commit changes, then the stash would be the diff of your current files and the state of these files at the commit. What I am trying to say is that I can't think of a case when you would need that.
But anyway, you can get the changes of the commit, create a diff, apply it and then stash whatever was the difference.
git diff YOUR-COMMIT^ YOUR-COMMIT > stash.diff
git apply stash.diff
git commit .
git stash
You don't have to create a temporary stash.diff file. You can simply pipe git diffs output to git apply.
|
I would like to create a new GIT stash from a commit on a branch. Is this even possible?
|
How can I create a GIT Stash from a Commit?
|
Access a Pull Request URL. Let's use https://api.github.com/repos/github/gitignore/pulls/566 as an example.
Parse the JSON object.
A Pull Request references two branches. The base branch is the merge target. Usually this is the master branch of the repository.
base.label is github:master, meaning it's the master branch for > github/gitignore.
base.ref is the branch name "master".
base.sha is the current SHA of that branch.
The head branch is what you're merging into the base.
master0 is master1, meaning it's the master2 branch for master3.
master4 is the branch name master5.
master6 is the current SHA of that branch.
|
The Github API (v3) allows you to get a listing of pull requests, and get more details on an individual pull request. What I can't seem to find is the name of the branch the pull request is coming from and the branch the pull request is suggesting the code be merged into.
Using the Github API how do you determine the branches involved in a pull request?
|
Github API: how to find the branches of a pull request?
|
GitHub has a nice article on this. You basically want to remove the files from Git history, but not from the file system.
If your file was pushed in your last commit, you can do:
git rm --cached path/to/your/big/file
git commit --amend -CHEAD
git push
If not, they recommend using BFG–a tool for cleaning up repositories (alternative to git-filter-branch):
bfg --strip-blobs-bigger-than 50M
This will remove files bigger than 50M.
|
Before, I used git locally without using .gitignore
Afterwards,
I created an .gitignore file, and write all unnecessary files in it.
When I push them to git repo, fatal: The remote end hung up unexpectedly error appears.
I dont want to push ignore files, but, somehow git tries to push them to repo.
Please help me, what is my fault? Thanks
|
How can I ignore big files and push to git repo
|
YES
Project management Sublime Style:
apm install project-manager
|
Recently I moved from Sublime Text to GitHub Atom editor. I wanted to create new project in Atom editor. How do I do it?
Is there any way to migrate Sublime Text project files to Atom project files?
|
Create Project in Atom Editor
|
phantomjs-prebuilt was renamed from phantomjs and now additionally contains binaries for version 2.1+.
npm -g install phantomjs-prebuilt
The fork phantomjs2 is still available which contains version 2.0.
npm -g install phantomjs2
Keep in mind that not all platforms might be supported.
|
I'm trying to install PhantomJS v2.0.0 using npm and after trying a couple of methods I've not found a working solution...
On NPM the latest version is 1.9.16, so I've tried the following in my package.json:
"phantomjs": "https://github.com/ariya/phantomjs/archive/2.0.0.tar.gz"
This gives me an error because there isn't a package.json for this version in the github repo.
"phantomjs": "2.0.0"
This tells me there is no version with this number available.
Am I missing something here?
|
How to install PhantomJS v2 with npm
|
By default if you create a Branch protection rule for any branch, it Disables force-pushes to all matching branches and prevents them from being deleted. So if you create a rule with the pattern master, it would prevent the master branch from deletion by default.
About how the rule pattern works, it uses fnmatch to match against any pattern provided to find out the branches to which the rule applies. For eg :
Rule pattern as * would apply to all the branches
Rule pattern as release* would apply to all the branches whose name starts with release
Currently I don't think you can set any single rule pattern on GitHub (I have tried) to match multiple branches like for eg master and develop, since ideally Disables force-pushes to all matching branches and prevents them from being deleted0 should match both the branches, but currently it doesn't, and according to the fnmatch documentation Disables force-pushes to all matching branches and prevents them from being deleted1
Check out more details on the above on GitHub help and the fnmatch documentation
|
It looks like the Github UI changed for settings/branches for a repo. I can no longer figure out how to prevent a branch from being deleted.
Does anyone know how to prevent a branch from being deleted? Aka, protect the branch?
|
Protect Github branches from being deleted
|
Refer Jitpack is best to import your project or libs from Github to gradle
For more information refer Gabriele Mariotti answer
|
I want to create the library and have access to it through the Internet.
In Android Studio (via Gradle) dependency may be added in this way:
In build.gradle (Module app):
dependencies {
...
compile 'com.android.support:design:23.1.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
...
}
How can I add my own library in this way from github?
|
How to create a library on Github and use it through gradle dependencies in Android Studio
|
They use the history API, or specifically, history.pushState().
You can use this, jQuery is not required, but there are plugins such as history.js.
This works on most browsers, namely Chrome, Safari and Firefox. IE10 and above supports this. In older IEs, you can fall back onto using the hash (window.location.hash).
GitHub also blogged about this.
|
Go to any GitHub page and click on any of the directories/files and observe how the URL changes but only part of the page is updated. There's no whole page reloading.
How do I do something similar using jQuery?
Does this work on most browsers (I'm using Chrome)?
|
How does GitHub change the URL without reloading a page?
|
Update:
This is possible as of 22nd of April 2020.
You can now share runners across an organization.
This allows for repositories within your organization to use those runners.
https://github.blog/2020-04-22-github-actions-community-momentum-enterprise-capabilities-and-developer-improvements/#share-self-hosted-runners-across-an-organization
Old Answer:
This is not possible as of yet, according to a Github Partner:
Currently, we have no methods to use the self-hosted runners across repositories, and also have no options to added self-hosted runners on Organization level.
Source: https://github.community/t5/GitHub-Actions/Can-one-Github-Actions-self-hosted-runner-work-for-multiple/td-p/41465
|
I have a Self-Hosted Github Actions runner running on my server for 1 of my repositories. But now I want to use that same runner for an other repo.
Is there a way that I can reuse that same Github Actions runner for an other repo without the need of creating a new runner?
|
Reuse Github Actions self hosted runner on multiple repositories
|
Since this was not expected behavior, I contacted Github Support and got this answer:
That number is accurate, and represents someone running git clone.
However, I did a little digging, and those clones came from only 4
unique users.
One possibility is that it's just a script gone wrong.
So it wasn't "normal" behavior, but not a Github bug. The answer to my question is that this statistic does represent the git clone command.
|
I have a Github repo with some confusing Git clone statistics. As you can see below, the repository does not have a large number of visitors or Stars, and yet shows a relatively large number of clones on a Sep. 29.
The Github help page for traffic is not very helpful, but I assumed that a "clone" statistic would count each individual clone command issued. It does not seem possible that 3 cloners cloned this repo almost 400 times in one day.
What else could this statistic represent?
|
Github - Traffic - Strange "Git clones" statistics
|
I agree with Yen Chi, he should have made this an answer. At the least, do an empty commit:
git commit --allow-empty
|
There was some github.com down time today that I wasn't aware of until I went to push about one dozen local commits.
https://status.github.com/messages
https://twitter.com/githubstatus
Here's the message I received when trying to push to github.com:
remote: Unexpected system error after push was received.
remote: These changes may not be reflected on github.com!
remote: Your unique error code: abcdefghijklmnopqrstuvwxuz
Now that github.com is back up, when I view the project commit history online, I can see these dozen commits have not been pushed up to the repo.
I figured I could just push these changes again with git push origin master, but I am told Everything up-to-date. Similarily a git pull origin master also shows Everything up-to-date.
How can I get these local changes pushed up to my repo on github.com?
|
Unexpected system error after push was received
|
It depends on your version of copilot and your settings.
Copilot is trained against a public corpus of data and it will use contents your local files provide context so Copilot can refine the results.
Copilot for business won't retain any of these snippets and will discard them immediately after returning the suggestion.
Code Snippets Data
GitHub Copilot transmits snippets of your code from your IDE to GitHub to provide Suggestions to you. Code snippets data is only transmitted in real-time to return Suggestions, and is discarded once a Suggestion is returned. Copilot for Business does not retain any Code Snippets Data.
Copilot for individuals may retain the snippets, depending on your settings:
Code Snippets Data
Depending on your preferred telemetry settings, GitHub Copilot may also collect and retain the following, collectively referred to as “code snippets”: source code that you are editing, related files and other files open in the same IDE or editor, URLs of repositories and files path.
When you commit your code to a public repo, it might get indexed in the future. The current index is based on the most recent dataset that GPT was trained against.
This is one of the advantages of how copilot works compared to similar features that were available in the past. It doesn't need to process and index all your local content into a machine learning model, yet it can still provide you tailored results.
|
Does GitHub Copilot save locally developed code? For example, if I develop code locally and in my code, there are connection parameters, like user and pass, for calls to remote services, do it save them as an example? Providing them as a suggestion in case someone else develops the same code in the future?
Also, in case of enterprise code development, where code must remain strictly confidential, can GitHub copilot save any sort of code (entirely or even just snippets) and make it public with suggestions?
|
GitHub Copilot and Privacy - Does GitHub Copilot save locally developed code?
|
15
One way to exclude a file from modifying a user's contribution activity is by associating the commit with a placeholder author. This can be done by providing an empty email field <> in the --author option.
The signature of the --author option: --author="NAME <EMAIL>"
git add package-lock.json
git commit -m 'initial commit' --author='nocontribute <>'
FOO_AUTHOR committed with REAL_AUTHOR x time ago.
Share
Improve this answer
Follow
edited May 31, 2017 at 14:21
answered May 31, 2017 at 13:44
mytherealmythereal
79311 gold badge99 silver badges2222 bronze badges
2
Awesome idea. Thx!
– zero_cool
Sep 11, 2017 at 14:47
This is helpful also for personal private repos of note, for instance when auto-saving Obsidian vaults! Nice trick!
– tarilabs
Oct 29, 2023 at 11:21
Add a comment
|
|
Now that npm v5.0.0 is out, using npm packages auto-generates a package-lock.json on npm install. In my case, my package-lock.json file happens to be close to 10,000 lines of code.
Npm also suggests this file should be committed:
npm notice created a lockfile as package-lock.json. You should commit this file.
I don't want this file to be included in the line counts for the contribution activity on GitHub.
I've tried setting the files as vendored code in .gitattributes, but that only affects the repository language.
Is there a way to exclude a file from the contribution activity without adding it to .gitignore?
|
Exclude package-lock.json from GitHub contribution activity
|
1
+100
I tried adding a second project to my workspace both ways:
Dragging the .xcodeproj file into the Project Navigator
File > Add Files to "WORKSPACE_NAME"...
The alert showed up both ways.
I also tried multiple times, clicking both Yes & No. Either way, none of my files being tracked by Git were changed, which I confirmed with git diff.
I Git ignore xcuserdata though. So, maybe it affects files stored in WORKSPACE_NAME.xcworkspace/xcuserdata/. I didn't check though because, frankly, I don't care about that data.
So, after adding the project to the workspace, I closed the workspace, and ran git clean -dXf (Careful! That command removes all ignored files, which may delete files you want to keep around.) so that if it did change any files that Git isn't tracking, well, now they're gone!
When I open back up the workspace, Xcode regenerates those xcuserdata files anyway.
Share
Improve this answer
Follow
answered Oct 19, 2013 at 21:39
ma11hew28ma11hew28
124k118118 gold badges456456 silver badges653653 bronze badges
1
5
What does this answer even mean? I've been tinkering around with iOS apps for a little while by now, and I'm a huge fan of Xcode's magical abilities. I can also confirm that picking either value doesn't seem to affect any files under git version control. But the point is that sadly none of what was mentioned in this answer has had any impact on helping me understand the purpose or consequences of this particular dialog message in Xcode 5.1. FWIW I checked the "Don't ask me again" and picked Yes.
– Steven Lu
Mar 19, 2014 at 23:30
Add a comment
|
|
I have a project using git for version control. I cloned a library to use from GitHub (also presumably using git). I added the downloaded project's .xcodeproj file to my own project and got this dialog:
Share working copy?
A working copy that has not been shared has been added to this workspace. Choose Yes to add this working copy to the Workspace Source Control Data.
What happens if I choose "Yes" or "No"? Which should I choose in this situation?
|
"Share working copy?" in Xcode when adding a project under git version control
|
1 - Generate a new token from git dev settings
2 - In SourceTree, you just need to change your repository settings there:
3 - Change the URL/Path with the new format:
https://<USERNAME>:<TOKEN>@<GIT_URL>.git
4 - Press OK and it is good now!
|
This question already has answers here:
Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead [duplicate]
(25 answers)
Closed 2 years ago.
FYI this is specifically for sourcetree
I am having this error when pulling in sourcetree, it was working just fine yesterday but it suddenly had this error.
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
fatal: unable to access 'https://github.com/London-Foster/frontend.git/': The requested URL returned error: 403
I tried having a personal access token and use it on source tree but still was not able to login.
|
Source tree fix for git Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead [duplicate]
|
The wiki is simply a separate git repository, so you can check it out and remove files the same way you would with anything else. Simply apply .wiki to the name (so if your repository is named my_repo, clone my_repo.wiki.git instead of my_repo.git) and clone to do this.
However, that said, you should definitely change your password anyway; it is compromised.
Github provides instructions to permanently purge a repository of a file here but it is my opinion that it's not worth bothering, given that the password should never be used again now that you have exposed it. You simply cannot know who has already pulled down the information and seen it (and numerous bad actors run scripts regularly on Github specifically to harvest credentials mistakenly committed).
|
Today I put my password to Github's wiki Home page. Then, I know it's a mistake.
How to remove this page? (I can remove child page, but I don't know how to delete wiki Home page)
|
How to delete Github's wiki homepage?
|
There are two ways to resolve this issue:
If the existing user has no activity, then delete this existing account.
Otherwise change his email to something else, then when the new user logs in, a new account will be created.
|
We are using GitHub Enterprise 2.5.1.
In our company, when a user switches to a new role, a new AD account will be created for him, with a new set of permissions. e.g. my current account is "huj" as a developer with email address "[email protected], if I become a BA, then:
The old account "huj" will be marked as "OIM Deletion" in AD.
A new account called "huj2" will be created for me, with the same old email address, [email protected].
My questions are:
As account is automatically created upon login, if I login to GitHub with the new account "huj2", I got this error: Unable to create the user because email [email protected] is already taken and emails is invalid.
How can I create the new account "huj2" in GitHub, with the same old email address.
What's the consequence of doing the above?
|
How to create a new GitHub account with the same email address?
|
There might be a chance that your problem is specifically with "uses: actions/setup-node". They mention in the docs that if you have multiple lock files or a lock file(s) in a directory that is not the root
In my case I had a single project with nested projects/dir. In my GitHub actions I wanted to run npm test on the nested project/dir so I had to specify to use my package.json inside the specific sub-directory. Double check to see that you are specifying the right directories with cache-dependency-path.
Specified here
https://github.com/actions/setup-node#caching-global-packages-data
|
I have a single Github repository for both server and frontend. The directory structure looks like:
root
|- frontend
|- server (Express App)
Github Action:
name: Node.js CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
working-directory: './server'
- run: npm run start
working-directory: './server'
I only have a single job to build the Express server (and not the frontend yet) so I set the working-directory to ./server. However, I still get an error:
Dependencies lock file is not found in /home/{username}/runners.../repository_name. Supported file patterns: package-lock.json,yarn.lock
So apparently it's not trying to run in .../reposirtoy_name/server.
I'm just trying to build both server and frontend in single Github action.
|
Github actions: Dependencies lock file is not found in runners/path
|
Use [text](link_to_wiki_page) where link_to_wiki_page is the full URL of the wiki page you want to link to. Just navigate to the page and copy/paste the URL from the URL bar.
|
I want link wiki-page to issue text.
[]() syntax links into issues pool.
[[text|page]] doesn't work.
How to do it?
|
GitHub link from Issue to Wiki
|
54
You can try with the complete https url:
git clone https://username:<token>@github.com/*****/******.git
If you omit the https:// part (and use ':' instead of '/'), it would be interpreted like an ssh url.
The GitHub help page "Which remote URL should I use?" confirms an https url can access private repos.
Note: I wouldn't put the token directly in the url, but use a credential manager to get the right password for the right user.
git clone https://[email protected]/*****/******.git
Reminder: since Aug. 2021 Token (or SSH key) authentication are required for all authenticated Git operations for GitHub.
Here, the token is a PAT (Personal Access Token).
Share
Improve this answer
Follow
edited Jan 27, 2022 at 8:18
answered Mar 31, 2014 at 7:04
VonCVonC
1.3m539539 gold badges4.6k4.6k silver badges5.4k5.4k bronze badges
3
1
when two-factor authentication is enabled, you would need to generate a temporary access token help.github.com/articles/which-remote-url-should-i-use/…
– mission.liao
Feb 24, 2016 at 14:39
1
@mission.liao I agree. I describe PAT (Personal Access Token) in stackoverflow.com/a/18607931/6309
– VonC
Feb 24, 2016 at 15:51
@alhelal that should follow the same principle, so yes, it should work with Bitbucket as well.
– VonC
May 25, 2018 at 5:03
Add a comment
|
|
I have configured Account A on my system with Global configurations and I can clone all my repos from there.
Now I don't want to change the configuration and I want to clone and do all operations of account B with my username and password. How can I do this?
I have tried:
git clone username:[email protected]:*****/******.git
But with no success.
|
Clone a private repo of github with username and password
|
Try to change your front-matter from visible:1 to visible: 1.
I just tried to reproduce your example on my machine, and I found that Jekyll seems to picky about the blanks in the front-matter.
With visible: 1, your example works for me.
With visible:1, Jekyll outputs the following error message while building the site:
YAML Exception reading C:/foo/bar.md: (): could not find expected ':' while scanning a simple key at line 5 column 1
...but it still finishes building and the generated site works, except that the post is not visible.
|
I am using jekyll with Github pages for my website.
I am trying to make some posts not visible in the home but they can be linked from another post.
In the frontmatter I tryed to add a field visible like this:
---
layout: post
title:
excerpt:
visible:1
---
And then in the index.html file I did a if check:
<div class="posts">
{% for post in paginator.posts %}
{% if post.visible== 1 %}
<div class="post">
<h1>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h1>
<span class="post-date">{{ post.date | date_to_string }}</span>
<a class="subtitle" href="{{ post.url }}">
{{ post.excerpt }}
</a>
</a>
</div>
{% endif %}
{% endfor %}
</div>
The idea is that when I set 0 in the visible field, the post won't be visible in the home. Unfortanely this is not working, do you have any hints? Thanks
|
Jekyll Github pages how to hide a post
|
After a long search and Try-n-Error i was able to find something which implicitly helped finding it out.
The way to implement a Codecov.io badge with your current Coverage ist the following :
In HTML :
<a href="https://codecov.io/github/<Your Organization/Acc.>/
<YourRepo>?branch=master">
<img alt="Coverage" src="https://codecov.io
/github/<Your Organization/Acc.>/<YourRepo>/coverage.svg?branch=master">
</a>
In Markdown:
[]
(https://codecov.io/github/<Your Organization/Acc.>/<YourRepo>?branch=master)
This Solution expects that you host the project on Github and that you upload the coverage reports.
|
As mentioned in the title, how can I add a Codecov.io badge resembling the coverage of my project?
There is nothing stated about this in the Docs from Codecov.io.
Thanks in advance.
|
How to display Codecov.io badge in GitHub README.md?
|
You can't show secrets through echo otherwise there would be a huge security problem (even using env variables as an intermediary).
However, this will work with the other variables you used, the problem in your case seems to be related to the syntax. You should use run: echo "$GITHUB_REPOSITORY" and run: echo "$GITHUB_REPOSITORY_OWNER" to see them directly on your workflow.
Note: ${{ github.repository }} or ${{ github.repository_owner }} also works.
Tip: You can identify most of the variables that can be shown with echo through the Github Context using run: echo "$GITHUB_CONTEXT" in your workflow.
Example:
Picture Reference
|
I'm trying to dive in the GitHub action, and so on the .ylm files, and to understand the process I would like to echo some environment variables, such as ${{ github.repository }} or ${{ github.repository_owner }} or event secrets like ${{ secrets.GITHUB_TOKEN }} or any other, and in the output I'm getting ***.
Is there any way to force the output to show the actual values instead of the asterisks?
dev.ylm
name: Dev
on:
workflow_dispatch:
push:
branches:
- dev
env:
BUILD_TYPE: core
DEFAULT_PYTHON: 3.8
jobs:
any_name:
runs-on: ubuntu-latest
steps:
- name: Any Name Bash Test Step
shell: bash
run: |
echo "GH_REPO: $GH_REPO"
echo "GH_REPO_O: $GH_REPO_O"
echo "GH_T: $GH_T"
env:
GH_REPO: ${{ github.repository }}
GH_REPO_O: ${{ github.repository_owner }}
GH_T: ${{ secrets.GITHUB_TOKEN }}
output
Run echo "GH_REPO: $GH_REPO"
echo "GH_REPO_O: $GH_REPO_O"
echo "GH_T: $GH_T"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
BUILD_TYPE: core
DEFAULT_PYTHON: 3.8
GH_REPO: ***/core
GH_REPO_O: ***
GH_T: ***
GH_REPO: ***/core
GH_REPO_O: ***
GH_T: ***
|
Echo Github Action Environment variables
|
You can create another repository to host all your builds , I mean executable files . With in that repository don't add any of your code other than your builds ,
As a result of this , people can click on download Zip button at git hub , which downloads only executable ( as a zip file ).
while building you can copy the executable file in a folder just push to remote repository which is hosting only builds .
Hope this helps .
basically , GIT is just an SCM ( source code management system ) it is not meant for this purpose .
but still this how you can utilize the service of github.org amd git .
hope this helps .
EDIT : -
Git hub now has a solution for hosting releases it has been well explained by @VonC in the post below . Please use that as a solution.
|
I want allow users to download executable of one of my project on github, without downloading all sources or browsing the entire project.
According to this similar question, you could use a upload/download service, which apparently, github has shut down.
So is there another way? Is github aiming at sharing code only, not software?
|
Hosting executable on github
|
Those links let you quickly compare or open a pull request from one your branch.
They're displayed when a recently pushed branch is ahead of the remote HEAD. Most of the time, the remote HEAD points to master (this can be changed by tweaking the "default branch" of the repository in the Admin section).
As it looks like your remote HEAD points to master, those links should not be displayed indeed. The good move would be to send a mail [email protected]..
|
I fast-forwarded a couple of development branches to be up-to-date with master, and pushed them to a private repository. The private repo is owned by the client's github account and I am a collaborator.
Now, github shows me two links under "Your recently pushed branches:", each containing "Pull request" and "Compare". When I click on "Pull request" out of curiosity, it shows me:
Oops! master is already up-to-date with feature Try a different branch?. It's the same story for any other branch because they are all fast-forward updated. So what is the point of these links?
|
Why does github show me "Your recently pushed branches"?
|
Click on the bell button on bottom right-corner of the Visual Studio Code Editor
Press 'Agree' button
Thats it!
|
I have installed GitHub Copilot just for the sake of testing. However, none of the commands work.
For example if I try CTRL + Enter I get this error message:
command 'github.copilot.generate' not found
I am trying it with JS file.
I have latest Visual Studio Code and Copilot installed.
|
GitHub Copilot Commands not working and showing error
|
You can achieve that by using HTML tag <video>.
Example:
| Video 1 | Video 2 |
| ------------- | ------------- |
| <video src="https://user-images.githubusercontent.com/13440061/129455220-23fa27a2-c8f0-4953-b291-b4893959d5d9.mp4"> | <video src="https://user-images.githubusercontent.com/13440061/129455220-23fa27a2-c8f0-4953-b291-b4893959d5d9.mp4">|
|
I would like to wrap a video link like this in a table cell in a README Markdown file. Is there any way to accomplish this?
|
Is there a way to wrap a Github README video link in a table cell?
|
28
To change your current origin to a new one, use:
git remote set-url origin <url>
Source:
https://help.github.com/articles/changing-a-remote-s-url/
Share
Improve this answer
Follow
answered Oct 22, 2018 at 3:33
spinalfrontierspinalfrontier
69711 gold badge1313 silver badges2121 bronze badges
Add a comment
|
|
I've recently cloned a repo to my local drive, but now I'm trying to push all changes to a complete new repo. However, git keeps telling me that permission is denied, and that's because it's trying to push to the originally-cloned repo.
DETAILS:
I originally cloned from https://github.com/taylonr/intro-to-protractor (i.e. based on a Pluralsight course at https://app.pluralsight.com/library/courses/protractor-introduction/table-of-contents ) .
Now that I've completed the course, I'd like to push my finalized code up to my own git repo (which I just created on github):
https://github.com/robertmazzo/intro-to-protractor
When I use the following git command:
git remote add origin https://github.com/robertmazzo/intro-to-protractor.git
it tells me remote origin already exists , which I guess is fine because I already created it on github.com.
However, when I push my changes up I'm getting an exception.
git push origin master
remote: Permission to taylonr/intro-to-protractor.git denied to robertmazzo.
fatal: unable to access 'https://github.com/taylonr/intro-to-protractor.git/':
The requested URL returned error: 403
So I'm investigating how I can switch to my new repository, but this is exactly where my issue is. I cannot figure this part out.
|
How to switch to a new remote git repository
|
39
The common issue is case mistake. I got the same issue before. The better way to do it is to check what are the branch names:
$ git branch
master
*branch1
Branch2
you can compare the branch on above, then push it with the name you got.
$ git push origin Branch2
or
$ git push origin branch1
Share
Improve this answer
Follow
answered Apr 26, 2017 at 18:56
KyleKyle
39933 silver badges44 bronze badges
0
Add a comment
|
|
When I do a git status, I get my branch:
$ git status
On branch OfflineLoading
When I tried to git push, I get:
$ git push origin OfflineLoading
fatal: OfflineLoading cannot be resolved to branch.
When I check the branches, it is not there:
$ git branch
branch1
branch2
branch3
branch4
How do I fix this?
|
How to fix "cannot be resolved to branch" on git push?
|
49
I had this problem too. If your school has its own Github organization, then you will need to go to github.com and in the top right go to Settings > Authorized applications > GitKraken.
From here you can grant the GitKraken application access to your school's organization and any other orgs you are a part of:
Here is a shortcut link to the page:
https://github.com/settings/connections/applications/a7557949433b7d282a76
Share
Improve this answer
Follow
edited Nov 16, 2016 at 21:47
answered Nov 16, 2016 at 21:23
phreaknikphreaknik
64555 silver badges1212 bronze badges
3
Thank you, that shortcut is needed if you want to give access to an organisation (as organisations cannot be logged into directly, they are not their own accounts).
– Kaspar Lee
May 14, 2019 at 21:06
3
wow, this seems over engineered. Repos can already have fine grained access restrictions, and GitKraken auths via Oauth and SSH keys, yet it needs one more step to authorise it for an organisation. SMH. Thanks for this, never would have found this on my own.
– Novocaine
Sep 20, 2019 at 9:15
2
Documentation about this issue in GitKraken: support.gitkraken.com/integrations/github Section 'Why can't I see my remotes or repositories in the drop down menu?'
– xab
May 22, 2020 at 10:35
Add a comment
|
|
I am using GitKraken to manage my repositories from github, and I am able to see and clone repositories I am the owner of no problem. However, I set up a repository with my school's github account, added many students, and am able to manage it no problem on github.com
However, GitKraken is neither able to see it in my clone from github section, nor is it able to add it by URL.
What am I doing wrong?
Thanks,
Adam
Error message:
Remote not found. Double-check your remote url, then make sure you have access to do that action on that remote and try again.
|
GitKraken is not showing repo I am a contributer to
|
page.url is the URL of the current page, without the host (e.g. /index.html), as documented in Page Variables. So, in this case:
{% if page.url == "/index.html" %}
something
{% else %}
other thing
{% endif %}
(However, I don't think you need this any more, your other problem is probably solved. :) )
|
I've just recently started using Github to host my blog (using Jekyll and Liquid). However, I'm having an issue which I can't currently fix. The issue could be hacked/solved if I was able to detect which "page" or "url" the user was visiting.
Something like:
{% if user_is_currently_at_this_url %}
{{ display something }}
{% else %}
{{ display something else }}
{% endif %}
Is this possible? Is there any other way around this issue?
|
Liquid markup to detect current page URL?
|
You can use <pre> in tables, as teh_senaus said. But if you do that, syntax highlighting won't work... or will it?
Through random experimentation I found that GitHub allows specifying it with <pre lang="csharp">. This has the same effect that ```csharp does of setting the syntax highlighting to C#.
This isn't really documented anywhere in GitHub's help center, nor in linguist's documentation. But it works, even inside of tables.
So for your example table, the new code would be as follows:
<table>
<tr>
<td>
<pre lang="csharp">
const int x = 3;
const string y = "foo";
readonly Object obj = getObject();
</pre>
</td>
<td>
<pre lang="nemerle">
def x : int = 3;
def y : string = "foo";
def obj : Object = getObject();
</pre>
</td>
<td>
Variables defined with <code>def</code> cannot be changed once defined. This is similar to <code>readonly</code> or <code>const</code> in C# or <code>final</code> in Java. Most variables in Nemerle aren't explicitly typed like this.
</td>
</tr>
|
Markdown has pipe table syntax but it's not enough for some cases.
| table | syntax | without multiline cell content |
So, we can use HTML table tags.
<table>
<tr>
<td>
```csharp
const int x = 3;
const string y = "foo";
readonly Object obj = getObject();
```
</td>
<td>
```nemerle
def x : int = 3;
def y : string = "foo";
def obj : Object = getObject();
```
</td>
<td>
Variables defined with <code>def</code> cannot be changed once defined. This is similar to <code>readonly</code> or <code>const</code> in C# or <code>final</code> in Java. Most variables in Nemerle aren't explicitly typed like this.
</td>
</tr>
But some time ago syntax highlighting was broken and this wiki page looks ugly now. Any ideas on how to fix this?
|
Github markdown, syntax highlight of code blocks in the table cell
|
30
I solved it by using the github-release tool.
Works like a charm and very easy.
Add a relevant parameters to the build
Add a shell script to your post build steps
Enter this code:
echo "Compressing artifacts into one file"
zip -r artifacts.zip artifacts_folder
echo "Exporting token and enterprise api to enable github-release tool"
export GITHUB_TOKEN=$$$$$$$$$$$$
export GITHUB_API=https://git.{your domain}.com/api/v3 # needed only for enterprise
echo "Deleting release from github before creating new one"
github-release delete --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${VERSION_NAME}
echo "Creating a new release in github"
github-release release --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${VERSION_NAME} --name "${VERSION_NAME}"
echo "Uploading the artifacts into github"
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${VERSION_NAME} --name "${PROJECT_NAME}-${VERSION_NAME}.zip" --file artifacts.zip
Share
Improve this answer
Follow
edited Nov 2, 2016 at 20:48
StephenKing
36.8k1111 gold badges8484 silver badges114114 bronze badges
answered Jan 20, 2015 at 9:38
Asaf ShvekiAsaf Shveki
73688 silver badges1111 bronze badges
3
13
There really should be a Jenkins plugin with support for Jenkins pipeline for this...
– Simon Forsberg
Jul 26, 2017 at 16:52
Thank you! But how do you add this tool to Jenkins pipeline?
– Albert Bikeev
Dec 8, 2020 at 12:41
you may download the binaries here and put them on your Jenkins server: github.com/github-release/github-release/releases/tag/v0.9.0
– Asaf Shveki
Dec 9, 2020 at 17:09
Add a comment
|
|
I'm searching for a way to upload a build artifact as Github Release in Jenkins as post-build action or publisher - similar to Publish Over.
This is not yet supported by the Github plugin for Jenkins (JENKINS-18598).
I've been looking into the postbuild-task plugin, but this doesn't seem to support environment variables (which I assume would be helpful to prevent logging my API token in the build output).
Has anybody done this, yet? What would be a good way to solve this with Jenkins? Uploading via cURL or via a CLI client (e.g. the Go-based github-release).
|
Upload build artifact to Github as release in Jenkins
|
Both github and bitbucket have REST APIs for issues (GitHub's, Bitbucket's), so you could write a (fairly) quick script to migrate issues. However, GitHub has no API for wikis (Bitbucket does), so, unfortunately, you'll likely have to do that by hand.
|
Recently, we decided to migrate our projects from GitHub to BitBucket. For now, I tested with few projects as BitBucket has direct import feature. Everything is just fine, except GitHub issues, and wikis are not imported. Since most of the projects are still in development and some in production, issues, and wikis are important for us.
I did quick Google search and could not find proper solution.
Is there any solution?
|
How to import GitHub issues and wikis to BitBucket?
|
Easy answer: move the old repo away and reclone. If you have stuff in the old repo you want to preserve, there are ways of getting them, but first get a good repo.
|
One of my cloned repositories is getting this from a git fsck
fatal: loose object 40bda4e3b79c3d7bf598df31d9e68470f97a3f79 (stored in .git/objects/40/bda4e3b79c3d7bf598df31d9e68470f97a3f79) is corrupt
I've got another copy of it that fsck's cleanly.
I've tried nuking the directory/subdirectories that contain the fatal one, and
recloning it. The problem continues.
I really don't care about any particular file, I just want the repository to
checkout cleanly. What do I do?
Note: the remote repository is hosted on github.
|
How to remove "fatal: loose object"?
|
27
Try creating a repository with .gitignore without any template makes create repository button disabled.
.gitignore template: None -> create Repository button is disabled.
Now either deselect the option or select a template, will make the button enabled.
Share
Improve this answer
Follow
answered Jun 30, 2021 at 3:43
Arpan SainiArpan Saini
4,87911 gold badge4545 silver badges5252 bronze badges
2
3
So silly, if you ask me. Unchecking the .gitignore option also fixes this.
– Dolphin 613 Motorboat
Jan 5, 2022 at 23:11
Thanks Fizz, i have already mentioned that too "Now either deselect the option or select a template, will make the button enabled"
– Arpan Saini
Jan 5, 2022 at 23:19
Add a comment
|
|
I am using macOS version 11.2.2 BigSur. I don't seem to be able to create a GitHub repository on the web (I am using safari). The button is greyed out or you say it as disabled.
There is no other problem in naming, storage etc.
Please suggest me some solutions.
|
Create repository button disabled on GitHub
|
Running git gcresolved this for me. This will do some garbage-collecting housekeeping tasks which could be causing this issue.
|
I cloned a repository from a github enterprise remote with the option "--mirror".
I'd like to push that repo in another remote repository but i've the following error:
> ! [remote failure] XXXX-7342f50b84fbfff3a2bbdcf81481dbcb2d88e5cd -> XXXX-7342f50b84fbfff3a2bbdcf81481dbcb2d88e5cd (remote failed to report status)
> error: failed to push some refs to '[email protected]:XXXX/YYYY.git'
> Branch master set up to track remote branch master from origin.
|
Git error when pushing (remote failed to report status)
|
19
GitHub plugin for IntelliJ lets you to save the password, so you don't have to enter it every time.
With keys
(adapted from Multiple SSH Keys settings for different github account, thanks to CrazyCoder comment):
Create ssh key pair
$ ssh-keygen -t rsa -C "[email protected]"
Add key
$ ~/.ssh/id_rsa_activehacker
Confirm that the key is added
$ ssh-add -l
Modify ~/.ssh/config
Host github.com-activehacker
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_activehacker
In IntelliJ
VCS > Checkout from Version Control > Git
Test
As you can see, you will still have to either enter passphrase for the key pair after every IntelliJ relaunch(I believe the passphrase is kept in memory) or let IntelliJ to store it permanently.
Share
Improve this answer
Follow
edited May 23, 2017 at 12:10
CommunityBot
111 silver badge
answered Dec 18, 2013 at 6:08
kukidokukido
10.5k11 gold badge4646 silver badges5252 bronze badges
3
1
Thanks, but this is not what I want. I've clarified the question regarding this point.
– OldManLink
Dec 20, 2013 at 10:52
@user55547 Updated the answer with ssh keys solution.
– kukido
Dec 20, 2013 at 20:15
3
Just a note for people who aren't familiar with .ssh config: it's a special file that allows you associate SSH identities with specific domains. This solution requires creating a config with the SSH address in the host field. SSH config tutorial here, just change the host to match your Git repo's domain.
– Indolering
Apr 30, 2015 at 23:19
Add a comment
|
|
I have successfully configured my GitHub client to use SSH, and received the confirmatory email from GitHub that a new SSH key was added. I would like to setup IntelliJ to use SSH as well, so that I don't have to enter my Username and Password every time I interact with GitHub. I also don't want IntelliJ to save my password for me, since I am unsure how secure that would be.
The closest I have come so far is that I need to edit my ~/.ssh/config file to tell IntelliJ that there is an SSH key it can use. Unfortunately I have not managed to find an example that works.
Here is my latest attempt at a ~/.ssh/config entry:
Host IntelliJ
HostName github.com
User git
IdentityFile "/Users/peter/.ssh/github_rsa"
TCPKeepAlive yes
IdentitiesOnly yes
I have tried restarting IntelliJ after adding that entry, but to no avail.
I'm running IntelliJ Ultimate 12.1.6 on Mac OSX 10.8.5
|
How do I connect IntelliJ to GitHub using SSH
|
41
git diff -- **/FooBar.aspx
In general * stands for any part of a filename while ** stands for any subpath. E.g. git diff -- **/main/**/*.aspx will diff only aspx files that are residing somewhere in a subdirectory of main or main itself. This applies to other commands that accept paths, like commit and add.
Share
Improve this answer
Follow
answered Nov 22, 2013 at 13:18
jarturjartur
52944 silver badges66 bronze badges
2
On Windows, this works for commit and add but oddly doesn't work for diff. It complains that you need to use '--' to separate paths, even though you are.
– Thomas Higginbotham
Aug 13, 2015 at 19:37
unfortunately this is not working on my zsh on ubuntu machine
– Aayush Neupane
May 24, 2021 at 4:21
Add a comment
|
|
I'm using the github windows shell and I'll do the following
git status
see a list of modified files and want to remind myself what's changed. I'll have to type something like
git diff Source\FooBar\Pages\FooBar.aspx
That seems like a lot of characters to have to type. Is there some easier workflow to look at diffs that I'm not seeing?
|
How to git diff without typing the whole path
|
41
Adding fail-fast: false under strategy works fines for me! :)
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x, 12.x, 13.x]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
Share
Improve this answer
Follow
edited Nov 26, 2021 at 14:47
Flimm
142k4747 gold badges259259 silver badges277277 bronze badges
answered Jan 9, 2021 at 20:55
ElleyElley
81099 silver badges1717 bronze badges
1
2
This should be marked as an accepted answer.
– marverix
Jan 30 at 9:53
Add a comment
|
|
I have the following GitHub Actions config file (parts removed for simplicity).
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x, 12.x, 13.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
The major problem I'm running into is that lets say the test for Node.js version 8 fails. But the rest succeed. In that event GitHub Actions tends to cancel all the jobs if one job fails.
Is there a way to change this behavior so all jobs will continue to run even if one has a failure? This can be helpful in pinpointing an issue with a specific version.
|
GitHub Actions Disable Auto Cancel When Job Fails
|
To create a new release and upload additional binaries, you can :
create the release using POST /repos/:username/:repo/releases and store the upload_url field from the response
upload your asset using POST $upload_url with additional parameters name and optional label (refer to this)
A quick example using bash, curl and jq (JSON parser) :
#!/bin/bash
token=YOUR_TOKEN
repo=username/your-repo
upload_url=$(curl -s -H "Authorization: token $token" \
-d '{"tag_name": "test", "name":"release-0.0.1","body":"this is a test release"}' \
"https://api.github.com/repos/$repo/releases" | jq -r '.upload_url')
upload_url="${upload_url%\{*}"
echo "uploading asset to release to url : $upload_url"
curl -s -H "Authorization: token $token" \
-H "Content-Type: application/zip" \
--data-binary @test.zip \
"$upload_url?name=test.zip&label=some-binary.zip"
|
I am using blow command to publish a release on Github repo:
curl -X POST -H "Authorization: token xxxxxxxxx" -d '{"tag_name": "test", "name":"release-0.0.1","body":"this is a test release"}' https://api.github.com/repos/xxxxxx
I can see that a new release is created. But there are two download buttons under it:
Source code (zip)
Source code (tar.gz)
How can I make a release without source code?
If I can't remove the source code attachment, how can I upload additional binary files? I tried to use the API Upload a release asset like this: POST https://<upload_url>/repos/:owner/:repo/releases/:id/assets?name=foo.zip, it returns successfully but I couldn't find the binaries on Github release tab.
|
How to use Github Release API to make a release without source code?
|
A gist operates like any other repository. So let's say you've cloned something like git://gist.github.com/2322786.git:
$ git clone [email protected]:2322786.git
(If you just wanted to try this without pushing, you can use git://gist.github.com/2322786.git, which will demonstrate the merge principle and works anonymously, but does not allow you to push.)
And now you want to merge in changes from git://gist.github.com/2661995.git. Add it as an additional remote:
$ git remote add changes git://gist.github.com/2661995.git
$ git fetch changes
And then merge in the changes like this:
$ git merge changes/master
And you should be all set. This should work regardless of whether the new gist was forked from yours at some previous point or is completely unrelated.
Taking Romain's comment into account, you would then issue a push:
$ git push
This would only work if your original clone URL allows writing.
|
I have a gist on GitHub that someone forked and made changes to. I like their changes.
Is there a way to merge the changes back into my original gist?
|
How to merge a gist on GitHub?
|
35
You can define manually executable workflows, with inputs.
on:
workflow_dispatch:
inputs:
environment:
description: 'Define env name'
required: true
default: 'prod'
branch:
description: 'Define branch name'
required: true
default: 'master'
Than you can use these predefined parameters like:
jobs:
printInputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Env: ${{ github.event.inputs.environment }}"
echo "Branch: ${{ github.event.inputs.branch }}"
I think you can support your use case with that.
More details here.
Share
Improve this answer
Follow
edited Nov 10, 2020 at 21:56
Jimothy
9,31055 gold badges3131 silver badges3333 bronze badges
answered Oct 19, 2020 at 9:12
hEngihEngi
8751010 silver badges2323 bronze badges
1
2
Additional bit of info possibly useful to know in this context: the gh command-line tool lets you invoke workflows and pass the input values on the command line. C.f. cli.github.com/manual/gh_workflow_run
– mhucka
Dec 12, 2022 at 21:15
Add a comment
|
|
I want to create a github action to create an integration test environment. We already have a dockerized script which can do this, however, the environment is made up of 2+ repositories. So, in order to make this effective during development, we'd need to specify the branches of the other repos.
For example, let's say I have a PR in repo: frontend, branch: my-feature-brach. It requires repo: backend, branch: their-feature-branch. I'd like to kick off a build from my PR where it uses the branch of that PR (in the frontend repo), and ask me which branch to use for the backend repo.
Is this possible?
|
User input in github actions (specify repo branch, etc)
|
16
The reason is that your repository is empty and you should make at least a readme file. It worked in my case.
Share
Improve this answer
Follow
edited Feb 5, 2022 at 10:08
Jasperan
2,30622 gold badges1919 silver badges4343 bronze badges
answered Jul 16, 2018 at 15:20
Brij Raj KishoreBrij Raj Kishore
1,63511 gold badge1111 silver badges2424 bronze badges
Add a comment
|
|
I cannot publish a bootstrap website from my local computer through Github desktop. It states: cannot publish unborn head
What does it mean? What changes should I make?
|
Github website publish cannot publish unborn HEAD
|
git is used for git in general you can use Bitbucket or GitLab any provider with it you just add remote and you can push.
But Github CLI is for Github you can manage many features of Github from CLI e.g issues.
I personally prefer git as I am more comfortable and in many offices I don't use Github. https://git-scm.com/docs/git-remote.html#_examples
|
What is the difference between git and GitHub CLI?
Which one should I use, git or GitHub CLI or gh depending on the situation?
For example, cloning a repository, both commands support it. What gives?
I am specifically asking for the GitHub CLI not GitHub itself.
|
What is the difference between git and Github CLI or gh?
|
The post-receive hook of Github are actually only "WebHooks", to communicate with a web server whenever the repository is pushed to.
For security reason, you cannot run anything on the GitHub server side.
When a push is made to your repository, we'll POST to your URL with a payload of JSON-encoded data about the push and the commits it contained.
You can use Requestbin to test your webhooks.
(check that the JSON actually comes from GitHub though)
Note: since late 2018, you can run actions on GitHub server-side, with GitHub Actions.
Actions are triggered by GitHub platform events directly in a repo and run on-demand workflows as autoscaled containers in response.
With GitHub Actions you can automate your workflow from idea to production.
See examples with sdras/awesome-actions.
Other examples, provided by Encryptex in the comments:
"How to setup continuous deployment of a website on a VPS using GitHub Actions" from Igwaneza Bruce.
|
how to run a post-receive hook in GitHub?. I know that there is the web-one but I want to write a custom script and do not want to receive a post from github.
|
How to run post-receive hook on GitHub
|
Although people tend to think of their repo on Github as the "official" one, remember that's a social distinction and not a technical one. From git's point of view every repo is on equal terms. That means as long as you have pulled every commit into your local repo, you can safely delete the one on Github. Then just fork the Octopress project on github, set it up as a remote on your local repo, and push. Git doesn't care which repo you originally got any given commit from. It "just works."
|
I setup an Octopress project following the given instructions (http://octopress.org/docs/setup/) which have you create a Github repository, and create a local repository on your machine. On your local machine you add a remote to the original Octopress repository and then issue a "git pull" command. Then you add a remote to your Github repository so you can push your changes to your repository.
All of this works as far as it goes, but it doesn't create a fork of the original project, meaning there's no obvious (to a newbie) way to issue a pull request to the original Octopress repository.
Is there a way for me to add a fork of the original Octopress repository to my instance of that repository on Github?
If there isn't a way, can I safely delete my Github instance of Octopress, fork the original on Github, and then add a new remote from my local repository to the newly forked Octopress?
|
Add Github fork to existing repository
|
You can download a snapshot of the tree at that commit over here. This is an exported tarball so you won't have any history. Is that what you're looking for? You can get to this by first looking at the commits he wants you to pull and then picking the latest one in the list. Navigating to this URL will give you the diff (i.e. it's examining the commit object rather than actual tree). You can now simply change the commit in the above url to tree or click on the "Browse code" button. Once you do that, there's a "Download ZIP" button on the right which allows you to download the tree.
If you want complete history, then you need to fetch mlwelles changes. You can do this by going to the mlwelles:master repository over here and adding that as a remote to your own local clone using git remote add mlwelles [email protected]:mlwelles/AFOAuth2Client.git. Then you can fetch the changes he's asking you to merge using git fetch remote master. The changes will be available in FETCH_HEAD. You can either view them using git checkout FETCH_HEAD and git log (or whatever), view the diffs using git diff FETCH_HEAD (against your current branch) or finally integrate the changes he's asking you to using git merge FETCH_HEAD. Once you do this, you can push the changes to your own repository using tree0 (assuming the original repository is added as tree1).
|
Say I have this pull request and I want to download it as if it was its own separate project. How do I go about doing that? I don't see any button for that functionality.
|
How do I take a GitHub pull request and simply download that as a separate project?
|
26
It's not possible currently. GitHub allows you, to attach files (pdf, docx etc.) in comments, but there is no way to delete them.
The behavior is similar to images: you can upload it, but you can't delete it from their cloud.
Just in case you uploaded a file that really needs to be deleted, there is always a GitHub Support.
Share
Improve this answer
Follow
edited Apr 25, 2016 at 16:18
answered Oct 19, 2015 at 13:30
Ionică BizăuIonică Bizău
111k9393 gold badges296296 silver badges479479 bronze badges
8
5
@FrédéricHenri But you can't delete images. Well, you can delete them from the post, but not from their cloud. Like I mentioned, there are needed Suportocat powers to do that.
– Ionică Bizău
Oct 19, 2015 at 13:35
1
I don't think this is limited to owners/collaborators: help.github.com/articles/… . In our repository someone used this to host unrelated (potentially harmful) files and we had to ask github support to delete them.
– wump
Apr 25, 2016 at 11:26
31
I'm wondering how both GitHub and GitLab are getting away with this in 2019, since GDPR is a thing... eugdpr.org
– ahogen
Jul 10, 2019 at 7:00
1
You also cannot edit the answer out - the edit history is available forever.
– skjerns
Jan 4, 2021 at 14:53
8
This is the greatest free image hosting service I've seen. Unlimited quota for everything you need!
– GetFree
May 19, 2021 at 3:51
|
Show 3 more comments
|
I am in need to remove an attachment in github issues. How do I do this. When you remove the issue comment, the attachment is still in github. How can I explicitly target to remove an attachment?
The format of such attachments is
https://github.com/<projectname>/<repo>/files/<somenumber>/<filename>.txt
Simple git rm does not work.
|
github: how do I delete an attachment in github issues?
|
V3 doesn't require a key, but there are some benefits to using one.
Note first off that this key is different than the old V2 key. It's generated from the APIs console (http://code.google.com/apis/console). You pass it the same way, with a key parameter when loading the JS.
Benefits of having a key include usage reports in the console, and a way for Google to contact you if you're going over the quota regularly. You can also purchase additional quota through the console. Finally, if you're using the Places API, it requires the use of a key.
You can set allowed referrers, so that your key can't be used by others.
|
Looking at the developers guide for the Google Maps Javascript API v3 it explains first about how to obtain an API, then shows examples of including that key in the HEAD section of an HTML page e.g.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE">
</script>
Is there any need to keep this key secret, given it is used for rate-limiting and suchlike? In particular I'm thinking about if I put my work onto something public such as GitHub, do I need to remove my API_KEY before committing?
Is the answer in configuring within the google API settings that the key is only valid if it the webpage the key is within has been served from a domain name that I control?
UPDATE - was using:
http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE" from Google tutorial linked above. Removed the api-key and all seems to work fine. Am confused about the Google tutorial telling me I need to use it though...
|
Does google maps javascript api-key (v3) need to be kept secret in HTML checked into github and if so, how?
|
12
You can add a repository by URL by going to File -> New/Clone and choosing "+ New Repository", then "Clone from URL".
This is on Mac SourceTree 2.0+
Share
Improve this answer
Follow
answered Jan 29, 2015 at 7:44
RogRog
4,08522 gold badges2626 silver badges3535 bronze badges
2
1
I believe the OP has asked how to connect accounts and not how to clone a single repo. ( deduction from the I see that I can add only GitHub, Bitbucket and Stash accounts part of the original Q )
– Obmerk Kronen
Oct 16, 2019 at 4:04
The answer shows that it's not possible to do as the original question is, and offers a practical alternative that works.
– Sam Sirry
Dec 7, 2022 at 14:31
Add a comment
|
|
I have a Git server. However, when I try to add a user to SourceTree, I see that I can add only GitHub, Bitbucket and Stash accounts. How I can run it with my own server?
|
How can I connect to my own Git server in SourceTree?
|
You should add the remote address for the original repository 'upstream' to your local repository (which is a clone of your Dde.git fork):
git remote add upstream git://github.com/secret_project/dev.git # public read-only URL
That will allow you to pull 'upstream' into your own branch (merging and resolving any merge conflict in test.txt).
Then you will push your local branch to your Dde GitHub repository.
See GitHub help page: "Working with remotes" for more details.
|
Let's say a repository from which I clone (and only read-only for me) is:
[email protected]:secret_project/dev.git branch: dev
I forked project and URL:
[email protected]:secret_user/Dde.git
(Which I have full access to: read+write)
But someone updated [email protected]:secret_project/dev.git from another forked version.
Let's say file changed on
[email protected]:secret_project/dev.git (test.txt)
content:
hi!
But my forked project has test.txt file with content:
hi
So how do I update the forked project locally and in my repository?
Which commands should I use? And please make an example with my showed repositories...
|
Update forked project on GitHub
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.