Response
stringlengths 8
2k
| Instruction
stringlengths 18
2k
| Prompt
stringlengths 14
160
|
---|---|---|
29
You can change this in the job.
Your Job > Configure > Build Triggers > Trigger Setup > Commit Status Context
Enter something in this field to override "default".
Share
Improve this answer
Follow
answered Sep 16, 2015 at 22:55
dayyandayyan
39344 silver badges66 bronze badges
5
"Commit Status Context" looks promising. However, it is not working in GHPRB 1.29. The context is created for the Build Triggered action but not to the other "Commit Status" actions.
– jmoody
Oct 26, 2015 at 12:08
@jmoody, that's what I'm seeing as well. Did you find a fix? Or are you still getting 'default' for everything except the Build Triggered action?
– Mike Cole
Nov 5, 2015 at 18:51
2
It looks like if you rely on the default settings for the plugin, you end up with this behavior. If you set the Context in the build settings specifically, it seems to work as intended.
– Mike Cole
Nov 5, 2015 at 19:05
@MikeCole setting the individual job's Commit Status Context field worked for me. I have two GHPRB configurations using this that run on each PR, and they behave almost identically however the second one does not get a "Details" link, and I'm not sure why yet.
– davidA
Mar 31, 2016 at 0:52
3
@meowsqueak (and mostly for posterity) Make sure you're using Build Triggers > GHPRB > Trigger Setup... > Update commit status during build > Commit Status Context not the Post-build Actions > Set GitHub commit status (universal) > Commit Status Context
– TolkienWASP
May 24, 2018 at 17:14
Add a comment
|
|
For our project we use GitHub. We have TravicCI enabled (as this was required for our project to use). Besides that, we've also got a full instance of Jenkins running with the pull request builder.
Now this all works fine, and in the overview of a pull request this looks like this:
Now as you can see travis is displayed nicely with a name. The Jenkins setup is however shown as 'default'. I'd like to change this to something else, however I can not find anything anywhere (github, jenkins, plugin settings) on how/where to change this. How do I change this?
|
Jenkins + Github Pull Request builder display name
|
If no one else has pulled, you should just get your local branch back to how you want it (probably by either resetting to a previous position, or by doing an interactive rebase to remove the unwanted commit), then push again to github with the -f (force) option:
git push -f <remote-name> <branch-name>
If other people have pulled, the usual advice applies: read the recovering from upstream rebase section of the git-rebase man page to see what you're doing to the others before you do your forced update.
|
I made a mistake .... and I don't know how to fix it.
I explain the issue.
I was working on my project, and I did a first commit.
In this commit 2 big useless files had been added...
I didn't wanted these files so I did a
git rm file
Then commited again.
And I'm stupid, because I pushed to github hehehe :).
I think you've found out the problem...
How can I remove definitively these files from my local and github repositories (especially github...)
I found some help on the internet, but I don't want to break all my repository.
Thanks
|
Undo a git push on github
|
The GitHub Actions documentation on performing tasks in a workflow states the following:
When you use the repository's GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs.
This means that you will have to create a personal access token and add this token to you repository secrets.
To generate a new personal access token go to your personal developer settings and generate a new token. Then go to your repository settings and add a new secret containing the personal access token, name it i.e. PAT.
In your release workflow template, replace:
token: ${{ github.token }}
With:
token: ${{ secrets.PAT }}
Now the on release created event the workflow will be triggered!
Note: This approach seems is a bit hacky, but is currently the only known workaround for this issue and can be considered a major design flaw of workflow integrations.
|
I have a GitHub Actions workflow implemented on the main branch of my repository which creates a new release of my package in GitHub. Then I have another workflow implemented which should be triggered on the creation of a release. This trigger, however, is not working.
Please note that GitHub abandoned their own actions/create-release@v1 project and advises to use the softprops release action.
My workflow template is as follows:
name: Main release
on:
push:
branches:
- main
jobs:
release:
name: 'Release main'
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v2'
with:
ref: ${{ github.ref }
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
body_path: CHANGELOG.md
name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
token: ${{ github.token }}
My on:release:created trigger workflow is as follows:
name: Act on release created
on:
release:
types: [created]
jobs:
build:
name: Build
environment: dev_environment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Test
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
The release and tags are correctly added in GitHub, so everything looks to work fine except that the workflow that should be triggered on the release is not executed.
How do I solve this?
|
GitHub Actions on release created workflow trigger not working
|
This fixed it:
brew install macvim --with-cscope --with-lua --HEAD
brew uninstall vim
brew install vim --with-lua
If it still doesn't work after running the previous commands:
When you install vim with brew, it probably didn't install it to the "correct" location. Looking at the terminal output during the installation (brew install vim) should tell you this location. For me, brew installed vim here:
/usr/local/Cellar/vim/7.4.712
Whereas when I ran which vim, I got the following result:
$ which vim
/usr/bin/vim
So all you have to do is:
sudo cp /path/to/newly/installed/vim /path/to/old/vim
In my case, I did:
vim0
|
I installed yadr onto my terminal, but I keep getting the following error when I open Vim:
neocomplete does not work this version of Vim.
It requires "if_lua" enabled Vim(7.3.885 or above).
EDIT:
Upgraded Vim to version 7.4.493 but still get the error.
Running OS X Yosemite
|
Problems with Vim and lua?
|
I'll try one by one:
I. You need to use git filter-branch only if you need to remove the files from your history completely. If those files do not contain any credit card information, then i think the following should be enough:
git rm --cached .DS_Store
git commit -m "{Your message}"
then add this file to .gitignore and commit it.
This will commit the removal of the file from the repository but will keep the file in working directory. If you push it though and then somebody else will pull this commit, they might have their file removed, so you MUST communicate this.
By committing .gitignore you will prevent other developers from adding this file again.
If you're not a maintainer, then i don't think you should do anything, but address this issue to the maintainer.
II. I'm a strong believer that hidden files of any nature are most of the time not supposed to be put into the repository exactly for that reason. Therefore i think that you should do the same thing with .xcodeproj as with .DS_Store and put it into .gitignore and commit it. .gitignore is the exception for the rule above.
III. If those files are properly ignored , then there will be no issues in future with them. If they are already in the repo and somebody wants do such cleanup it should be done by maintainer and communicated inside the team.
Hope that helps!
|
I can create a repo and use GitHub / BitBucket fine for my own projects. I have had problems when collaborating with other developers or trying to fork a project on GitHub.
I am aware of other answers like Best practices for git repositories on open source projects but there are OSX / Xcode specific problems I want to know how to solve.
.DS_Store files can be a pain. You can use .gitignore to prevent, but what happens if they have already been included, or another developer adds them back in through a clumsy git command?
The .xcodeproj will have changes to the directory names and developer profiles for the other person. What's the best way to do merges or to avoid conflicts?
If I have forked or pulled from a github project, how can I clean up these issues and also minimise merge conflicts for the maintainer?
If people have an example .gitignore created for Xcode, or scripts they use to initialise their repos then that would be great!
|
Best practices for Xcode + Git for multi-developer projects
|
GitHub for Windows ( after the popular GitHub for Mac ) with bundled Posh-Git ( powershell extension ) is also available - http://windows.github.com/
Atlassian's SourceTree is also coming soon to Windows - http://blog.bitbucket.org/2013/02/14/sourcetree-for-windows-beta-signup/
|
Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Can someone advise any windows client for GitHub?
I found the Tower client Mac (http://www.git-tower.com/) and seems it has very good integration with GitHub via API. Do you know any clients for windows with similar functionality?
Update Yes Thanks all for answers, I know about these three, but they only have integration with GIT, not GitHub. I mean some social features of GitHub, such as review of Incoming Request, comments for these Incoming Request, internal GitHub messaging support, possibility to create new repository on client, manage GitHub repository settings, and similiar features, subscribe to other repository and get notifications when they change. As I know, most of these feature available in GitHub API, but I can't found any windows client that use this API.
|
Is there any github client for Windows [closed]
|
This is actually quite simple. You can move your existing history into a Gist repo like you would move it into any other:
Create a Gist (simply enter a few random characters, so it gets created; enter a title if you want)
Copy the URL of the newly created Gist (it has the form https://gist.github.com/<LONG-HEXNUMBER>.git (if you prefer using SSH URLs, you can use [email protected]:<THAT-SAME-HEXNUMBER>.git instead)
In your existing local repo, do git remote add origin <URL>, where origin is an unused local name for the remote
Push your changes: Assuming you have a local master branch, you will want to overwrite the remote one with git push -f origin master
Push any other branches or tags you want on the remote as usual.
|
I have a Git repository on my computer with a single file coins.py
How can I get that as a Gist on Github, preserving history?
|
How to upload one file repository to Gist, preserving history?
|
One option to investigate Google Custom Search.
You mention trying to use Google in the past, but I'm not sure if you mean the custom search box as described here. Posting this in case it helps.
|
I am looking into migrating my site from Wordpress to Jekyll and would like to maintain the ability to have full-text search for the site. The Wordpress search was fast, reliable, and nicely formatted to match the theme, and I haven't found a decent replacement.
There's a plugin solution that uses indextank, but I am not interested in tying my search through a commercial API with users ranking the search items, I just want something comparable to Wordpress search.
I've also looked into the google Ajax api, but I don't want a floating ajax search box on the site.
There's always google's search for the website, but I haven't found this to be as reliable. (I haven't tried this since I moved to wordpress a few years ago, so perhaps I'm mistaken).
Since all posts are available in plain-text, it seems like it should not be to difficult to create an index for searching them when the site is built, but I have not found a good solution. Any suggestions or examples?
|
How can I add a site search feature to a Jekyll Blog?
|
You have to use SSH keys. Create one for each computer and register them all to the repo that you need to access. Doing this allows you to remove access computer by computer.
Once you have the SSH keys configured in Github, you can read this article to setup the Personal Access Tokens.
https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
UPDATE It tells you how to change to the token in the documentation
Using a token on the command line
Once you have a token, you can enter it instead of your password when
performing Git operations over HTTPS.
For example, on the command line you would enter the following:
$ git clone https://github.com/username/repo.git <--- HTTPS, not SSH
Username: your_username
Password: your_token <-------- THE TOKEN, not your password
Personal access tokens can only be used for HTTPS Git operations. If
your repository uses an SSH remote URL, you will need to switch the
remote from SSH to HTTPS.
If you are not prompted for your username and password, your
credentials may be cached on your computer. You can update your
credentials in the Keychain to replace your old password with the
token.
Instead of manually entering your PAT for every HTTPS Git operation,
you can cache your PAT with a Git client. Git will temporarily store
your credentials in memory until an expiry interval has passed. You
can also store the token in a plain text file that Git can read before
every request. For more information, see "Caching your GitHub
credentials in Git."
Also found a good video walkthrough that may help clear up a few things.
https://www.youtube.com/watch?v=kHkQnuYzwoo
|
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.
Today GitHub surprise me with a new way to push, clone, or pull a repo
when I'm trying to push my project I get this error message:
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/barimehdi77/Philosophers.git/': The requested URL returned error: 403
after multiple searches I fined that GitHub adds a new security update named Personal access tokens but who can I use it?
|
how to use Personal access token to clone, pull, and push a repo? [duplicate]
|
This is feasible with GitHub Desktop since version 1.0.7 considering the following:
If the current branch does not have any commits ahead upstream (the original repo of the fork), the new commits can be pulled without creating a new merge commit
In GitHub Desktop:
Clone your repository from File > Clone Repository
Fetch origin, which will automatically fetch the upstream as well
Go to Branches by clicking on where it says Current Branch
Click on Choose a branch to merge into <branch> at the bottom
Search for upstream/<branch>, then click Merge upstream/<branch> into <branch>
Push to origin, et voilà!
Otherwise, ff the current branch has commits ahead of the fork, then of course one has to create a merge commit or rebase and force push. For rebasing which might be more preferable, do the following:
In GItHub Desktop, go to Branch from menu, then Rebase Current Branch
Search for upstream/<branch>, then click Fetch origin0
Solve any conflicts that have occurred from the rebase
Force push to origin. You will get a warning for this for obvious reasons.
For avoiding force-pushing to your work when your current branch is both ahead and behind its upstream counterpart, either create a new merge commit or:
Make a new branch based with all your changes
If needed, reset the original branch to its original state (before it diverged from the original repo)
Perform the steps from the first scenario and merge your changes into your branch.
And yes, it seems that pulling via the GitHub website from the original repo without creating a pull request and merge commit is not possible at this moment.
Demo GIF for first scenario: https://i.stack.imgur.com/Ufrmk.jpg
Some GitHub issues related to this:
Add an upstream to forked repositories
multi-remote support in Desktop
|
The normal GitHub flow to contribute to a repo is to create a fork of the upstream, clone a local copy where you make changes, then push back up to your fork and then create a PR to have your changes merged into upstream.
But if upstream changes after that, how do you update your fork without creating a merge commit (and also without using the git CLI)?
I already know how to do this in a way that will create a merge commit or which depend on the git command line interface. This question is specifically about using the GitHub.com website or GitHub Desktop application only (no CLI).
Since this is a very common workflow it seems like there should be some simple way to do it using the GitHub GUI.
To reiterate: any answers that use the CLI or create a merge commit (e.g. this way) will not be answering this question since I'm explicitly looking for a non-CLI solution.
|
How to keep a GitHub fork up to date without a merge commit or using CLI?
|
2019: As mentioned in moby/moby issue 679:
it looks like github allows [A-Za-z0-9_.-], and transforms all other
characters to "-".
So: in addition to letters, numbers, - and _ the only other allowable character is '.'
This is illustrated in GitHub Desktop application, with desktop/desktop issue 3090: "Block emoji from being entered as a repo name"(!)
2023: Qunatized mentions in the comments:
I just checked on GitHub and was able to create repositories that:
start with "." or "_",
end with "." or "_",
contain an arbitrary number of consecutive "." or "_" characters, or any combination thereof.
It only converts any characters outside of [A-Za-z0-9_.-] to "-0".
I checked, and a repository name can also start or end with '-1', in addition of '-2' and '-3'.
So the current regexp (June 2023) for valid GitHub repository name would be:
-4
|
In addition to - and _, which other special characters can be contained in a github repository name?
Background
I need to do some regex on github urls, and need to know the rules for repository root urls, which are of the form
https://github.com/username/repo
where
username is the username of the owner of the repository, and,
repo is the repository name
So far, my regex works well, but doesn't cater to repositories with special characters, so I must include them. Written in R, the regex is github.com/*/[[:alpha:]].
Note: Here are listed the rules for github usernames - I am after the same thing but for repository names
|
Rules for special characters in github repository name?
|
You may go to File > New File at the root of your git repository (same directory as where your .git hidden folder is in). Then add all the directories/file that you want to be ignored into that new file and save it as .gitignore. (You can save as a plaintext file and just name it .gitignore within VS Code.
|
So I know this might sound like a noob question but I'm rather inexperienced with GitHub. I want to add a gitignore file to my repository, but I am unable to do so and I don't know how. I want to make sure a file is gitignored My visual studio code is connected with my repository. So I am able to push and pull via visual code.
Greetings,
Parsa & Liyam
|
How do I use .gitignore in visual studio code?
|
The first command (git checkout refs/pull/1/head) didn't work because refs/pull/1/head is the name of the reference in the remote repository. You don't have a reference with that name in your local repository because your fetch refspec translated it to refs/remotes/origin/pr/1/head.
The second command (git checkout origin/pr/1/head) should have worked, although it should have given you a "detached HEAD" warning. Was there a typo that you fixed when posting your question to Stack Overflow?
Your fetch refspec told git to translate the remote references into local references in the refs/remotes directory. The references in that directory are treated specially -- they're "remote references" meant to indicate the state of the remote repository the last time you did a fetch. Normally you don't want to check those refs out directly -- you want to create a local branch that is configured to "follow" or "track" the remote reference (which enables special convenience shortcuts such as the @{u} revision parameter and easier push/refs/pull/1/head0 usage).
Try:
refs/pull/1/head1
The above creates a new local branch called refs/pull/1/head2 (I recommend calling it refs/pull/1/head3) pointing at the same commit as refs/pull/1/head4, configures refs/pull/1/head5 to track refs/pull/1/head6, then switches to the new branch.
|
I have a list of pull requests on github. I can fetch the pull requests like this:
git fetch origin +refs/pull/*:refs/remotes/origin/pr/*
I get output like this:
* [new ref] refs/pull/1/head -> origin/pr/1/head
* [new ref] refs/pull/1/merge -> origin/pr/1/merge
* [new ref] refs/pull/10/head -> origin/pr/10/head
* [new ref] refs/pull/10/merge -> origin/pr/10/merge
* [new ref] refs/pull/11/head -> origin/pr/11/head
* [new ref] refs/pull/11/merge -> origin/pr/11/merge
Now I want to checkout one of those refs. Nothing I try seems to work:
$ git checkout refs/pull/1/head
error: pathspec 'refs/pull/1/head' did not match any file(s) known to git.
Or:
git checkout origin/pr/1/head
error: pathspec 'origin/pr/1/head' did not match any file(s) known to git.
How can I checkout this reference?
|
git checkout remote reference
|
As it says in the documentation:
--all
Push all branches (i.e. refs under refs/heads/); cannot be used
with other <refspec>.
--mirror
... specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored ...
So a, if not the, key difference is that one means refs/heads/* and one means refs/*. The refs/heads/* names are the branch names. Anything in refs/remotes/ is a remote-tracking name, and anything in refs/tags/ is a tag name. Other notable name-spaces include refs/0, refs/1, and the singular refs/2.
The refs/3 option goes on to mention:
locally updated refs will be force updated on the remote end,
and deleted refs will be removed from the remote end.
Hence refs/4 effectively implies both refs/5 and refs/6; refs/7 does not. You can, however, add refs/8 and/or refs/9 to refs/heads/0, if you like.
It is always up to the other Git to decide whether to obey polite requests (those sent without refs/heads/1) or commands (refs/heads/2) to make changes to its references.
With deleted local branch, refs/heads/3 doesn't push it and refs/heads/4 does.
This is a consequence of the refs/heads/5 option: telling your Git to use refs/heads/6 means "ask them to delete names in their name-space(s) that are not in mine".
|
What is the difference between git push --all and git push --mirror?
I only know this:
With deleted local branch, --all doesn't push it and --mirror does.
This is correct?
Any other differences?
|
Git push --all vs --mirror
|
It means GitHub is down. It means you can't use GitHub any more. See https://status.github.com/.
I guess you can bask in the unicorn's glory or something? Other than that, you can do pretty much whatever you like.
One thing that also isn't down is https://developer.github.com/.
|
I went to view my repository on Github.com and was presented with a giant pink unicorn and a message saying:
No server is currently available to service your request.
Does this mean something is wrong with my repository or account? Have I made in error in my repository?
If not, what's the issue?
|
What does a unicorn image on Github.com mean?
|
Question 1. How can I do this in git?
git checkout branch_a
git pull
git checkout -b branch_b
You'll then have the commits from branch_a in your new branch_b.
Question 2. Once I merge Branch 'A' to master, will that also include Branch 'B' even though i'm not done yet?
No, they're entirely separate branches so only the commits from branch_a will exist in master.
Question 3. Can I merge Branch 'B' independent of Branch 'A'?
Sort of a two-pronged approach here. If you want to take branch_a commits with you, then you can merge branch_b into master at any time, although that sort of voids the purpose.
Given that branch_b's tests presumably depend on branch_a it would seem silly to merge B before A.
Once you have merged A into master, you will probably need to rebase branch_b onto the new master, and get rid of all of the original commits you took over from branch_a, since they all now exist in master:
branch_a0
This will give you a fresh branch_a1 from master, where the commits from A now exist, and you won't have merge conflicts when you merge B into master.
The force push will only be required if you've already pushed branch_a2 to origin. If you haven't, no problem.
|
I'm working off of master and create Branch 'A'.
Branch 'A' contains HTML/CSS/JS to create a 'widget'.
While this code is being reviewed I also want to work on creating tests for this 'widget'.
I can't work off of master yet because Branch 'A' hasn't been merged. But I need a way to work off of Branch 'A' without making updates to it while the code is being reviewed to push to master.
I figure I need to make Branch 'B' off of Branch 'A' so that I can continue working off of the code I had already created.
Question 1. How can I do this in git?
Question 2. Once I merge Branch 'A' to master, will that also include Branch 'B' even though i'm not done yet?
Question 3. Can I merge Branch 'B' independent of Branch 'A'?
|
Git Branch Off A Branch
|
The easiest way to update it is probably to go into the package-lock.json file as you suggested and modifying the old "version": "#.#.#" to be "version": ">=1.4.3" under the url-parse JSON object. I'd suggest COMMAND+Fing the dependency name (CONTROL+F for the W indows users) since the package-lock.json file can easily be thousands of lines long, and once you find your dependency, changing the version number to what GitHub deems to be safe from the vulnerability.
I just created a new repo and I got a very similar message for the ws dependency, and after updating the version in the package-lock.json file manually I received this message after refreshing the GitHub alerts page:
No open alerts on ws were found in package-lock.json.
Alerts may have been resolved and deleted by recent pushes to this repository.
For reference, here's what it looked like for me before I updated the "version": "#.#.#"0 dependency:
"version": "#.#.#"1
and after:
"version": "#.#.#"2
You've probably already figured this out by now, as I see you posted this question almost a year ago, but leaving this here to help anyone in the future who comes across a similar issue.
|
I've received for the first time a notification from GitHub about a potential security issue (label: high-severity) with some of my project's dependencies. Here's the sample message:
url-parse vulnerability found in package-lock.json
And this is the proposed solution:
Upgrade url-parse to version 1.4.3 or later. For example:
"dependencies": {
"url-parse": ">=1.4.3"
}
or…
"devDependencies": {
"url-parse": ">=1.4.3"
}
Now, what I did was to simply check for any outdated packages by running npm outdated -g --depth=0 in my terminal as per the official documentation and execute the npm -g update command (I also tried targeting the dependency itself with npm update url-parse). A few packages were successfully updated, but it didn't seem to find the package causing the issue. Am I supposed to update it manually by adding the suggested line of code: "url-parse": ">=1.4.3"?
And finally, how much should I be concerned with such alerts?
Thank you!
|
How to update a dependency in package-lock.json
|
git branch -v indicates that my commit was on (no branch). As for the add, I initially commited the changes through Eclipse (with the git plugin)...when I do git add from the command line, it doesn't seem to do anything
That means you are in a DETACHED HEAD mode.
You can add and commit, but from the upstream repo point of view (ie from the GitHub repo), no new commits are ready to be pushed.
You have various ways to include your local (detached HEAD) commit back into a branch, which you will be able to push then.
See:
"Not currently on any branch + git commit + checkout when not in any branch. Did I loose my changes?"
"detached HEAD explained".
"Git: How can I reconcile detached HEAD with master/origin?"
"Git Lesson: Be mindful of a detached head"
"Git Tip of the Week: Detached Heads"
The OP mentions this article in order to fix the situation:
"git: what to do if you commit to no branch"
all we need to do is checkout the branch we should have been on and merge in that commit SHA:
Note that instead of merging the SHA1 that you would have somehow copied, you can memorize it with a script, using head=$(git rev-parse HEAD):
See "git: reliably switching to a detached HEAD and then restore HEAD later, all from a script".
Then you can merge that detached HEAD back to the right branch.
|
On github, I forked an old version of another project. I made some changes and am trying to push them onto my fork on github. I commited the changes locally, then tried git push, but this simply tells me "Everything up-to-date". When I browse the project on github, however, nothing has changed: it still shows the files (from the latest version) on my fork, unmodified. How can I push the changes to my github account?
(I realize this isn't much information...what else can I say? I have a feeling that it may be because I'm modifying the files directly in (home)/git/(project)...?)
|
cannot push to github: everything up-to-date
|
Well, there's the hg-git plugin that you could use. It allows you to use hg to talk to a git server. With the plugin, you could simply pull from the repository on Bitbucket and push to the repository on Github using Mercurial.
As described on the plugin homepage, this process is lossless, so it's possible to work with the Github repository as if it was just another Mercurial repository. Obviously, the Github/Bitbucket web interfaces still won't integrate with one another tough.
On a personal sidenote, I really wish Github/Bitbucket would somehow be able interoperate, but I guess that is wishful thinking ;-).
|
What's the quickest way to clone/fork a Mercurial repo from BitBucket to a Git repo in GitHub?
I'm aware that I can clone to a local repo, convert to git and then push to a new GitHub repo. Let's call this the manual way of doing this. I'm also aware that this isn't really a "fork" since the two repos aren't connected in any way. That's fine with me, I just want to be able to use this repo as a submodule and don't care that much about being able to send pull requests to the original hg project. I'm just wondering if there's some tool to automate this process. A kind of BitBucket-Git clone tool.
|
Forking an hg repo from BitBucket into a GitHub repo
|
You should be in the branch you are currently modifying (not master) and first merge master into this branch: under source control, click the three dots and select in the menu Branch -> Merge Branch (see screenshot) and select Master. It will say you now have conflicts that you need to resolve manually, and then you should be clear to go.
|
I can't figure out how to resolve the conflict in this pull request so that I can merge it. How can I fix the problem using the VSCode GitHub Pull Requests and Issues GUI?
There are only three lines that have changed, all within one file, for this pull request. The pull request description and diff are shown in the first two images below, respectively. Nothing there seems to be in conflict. However, when I look at the code for the master branch that I am trying to merge into, shown in the third image, line 17 is different. I think that is the conflict. Why doesn't that conflict show up in the diff? How can I keep line 17 from the master branch, add line 17 from the pull request below it, merge back to the master branch, and close the pull request? I haven't found a way to view the pull request code side by side with the master code and I'm not sure which I need to push updates to.
I am trying to merge the pink branch in the graphic below.
|
How to resolve branch conflicts in VSCode GitHub Pull Requests and Issues extension?
|
Since the passphrase seems to be the issue, you might need to add your key to the ssh agent in your GitHub Action workflow.
See as an example "Using a SSH deploy key in GitHub Actions to access private repositories" from Matthias Pigulla, which proposes:
# .github/workflows/my-workflow.yml
# ... other config here
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: Some task that fetches dependencies
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: ./fetch-deps.sh
But he has also defined since then actions/webfactory-ssh-agent
This action
starts the ssh-agent,
exports the SSH_AUTH_SOCK environment variable,
loads a private SSH key into the agent and
configures known_hosts for GitHub.com.
|
When I connect to my server through my local computer I can successfully connect to Github using ssh.
I used this tutorial to setup the ssh keys.
However, when using Github actions I get this error:
err: [email protected]: Permission denied (publickey).
err: fatal: Could not read from remote repository.
err:
err: Please make sure you have the correct access rights
err: and the repository exists.
This is my Github actions YML:
name: CI App to DO
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
deploy-do:
runs-on: ubuntu-latest
steps:
- name: SSH to server and Deploy App
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/app
git pull origin master
npm run build
pm2 restart next
When running ssh-add -l on the server through my local machine I get my key but when doing the same through the Github actions workflow I get:
The agent has no identities.
My server is hosted on a Digital Ocean Droplet using Ubuntu 20.04.
As stated previously, this works great when connecting to my server through my local machine and doing the git pull there. I use MobaXterm for connecting to my droplet.
Edit: I am able to make this work when not using a passphrase.
In my local machine i'm using MobaXterm
|
Git Permission denied (publickey) when accessing server through Github Actions CI/CD
|
GitHub uses its own Markup library to render files like READMEs. It supports:
Markdown (.markdown, .mdown, .mkdn, .md)
Textile (.textile)
RDoc (.rdoc)
Org (.org)
Creole (.creole)
MediaWiki (.mediawiki, .wiki)
Restructured Text (.rst)
AsciiDoc (.asciidoc, .adoc, .asc)
Perl Pod (.pod)
|
I have noticed that many different file types are used for GitHub READMEs. The most common ones are .md and .rst
After looking at the GitHub documentation and the help page I found no information on which file types are allowed.
I am just looking for a list of the types so I can figure out which types I can use for my next README.
|
What file types does GitHub support for README's
|
The problem is the HTTP response type is text/plain but you will need application/json for most clients to handle it properly.
Update: using rawgit.com I was able to get your test working with the correct content-type.
My test Gist: https://gist.githubusercontent.com/anonymous/85dbc2c71023f24c2e26/raw/849848a71a1805a314897f9fe98eb7dc43e2e9b9/gistfile1.json
My RawGit URL: https://rawgit.com/anonymous/85dbc2c71023f24c2e26/raw/849848a71a1805a314897f9fe98eb7dc43e2e9b9/gistfile1.json
Using HTTP GET, sending over:
GET https://rawgit.com/anonymous/85dbc2c71023f24c2e26/raw/849848a71a1805a314897f9fe98eb7dc43e2e9b9/gistfile1.json HTTP/1.1
Accept: application/json
Host: rawgit.com
Receiving back:
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 24 Dec 2014 10:57:07 GMT
Content-Type: application/json
Connection: keep-alive
X-Content-Type-Options: nosniff
X-Robots-Tag: none
RawGit-Naughtiness: 0
Access-Control-Allow-Origin: *
ETag: "0250189db62d31523a5cd0da47449eb4"
Cache-Control: max-age=300
Vary: Accept-Encoding
RawGit-Cache-Status: HIT
Content-Length: 104
[{ Name: "Vignesh", Salary: 30000 },{ Name: "Yuvraj", Salary: 90000 },{ Name: "Nithya", Salary: 87000 }]
And a couple screenshots:
|
I came across a gist which returns JSON data
https://gist.githubusercontent.com/rdsubhas/ed77e9547d989dabe061/raw/6d7775eaacd9beba826e0541ba391c0da3933878/gnc-js-api
I tried to create one to return JSON data and ended up like this
https://gist.github.com/vigneshvdm/862ec5a97bbbe2021b79
How can i create a link like the first one and make it return data in JSON format
|
how to create a gist in github that returns json data
|
The concept I was looking for was the prereceive hook
|
Currently we are using SVN.
I would like to start using GitHub, but one absolute requirement is that we will need to have precommit (premerge) validation of the code like we currently have. Does GitHub support precommithooks (premergehooks)?
We're a team of 5 developers. We made an agreement that all code (JavaScript) should pass JSLint-like validation. Voluntary validation has proven not to work because it's easily forgotten. How can we be sure that code that becomes available to the others is guaranteed to validate against JSLint (or similar)?
|
does github support precommithooks?
|
29
So far, you have only renamed your remote branch from main to master. So, to change your local branch name, first, checkout branch main (if you aren't already on it):
$ git checkout main
Next, rename branch main to branch master:
$ git branch -m master
Then, set origin/master to track your local branch master:
$ git push -u origin master
Share
Improve this answer
Follow
answered Apr 29, 2021 at 1:21
Jacob LeeJacob Lee
4,50022 gold badges1818 silver badges3838 bronze badges
1
Thanks, I really appreciate your answer.
– Mostafa Yasser
Apr 29, 2021 at 22:39
Add a comment
|
|
I'm learning to use GitHub, I found that my default branch is main although I've changed it to master using my account in GitHub website but it still appears on the command line as main. It has caused many problems in the authentication process in every git push command, I want to change the main branch to be (master => origin) like usual. Can anyone help me?
|
How to change the main branch to master on github command line?
|
There is no ongoing merge pending so git is supposed to show you,
fatal: There is no merge to abort (MERGE_HEAD missing).
Now if you want to go back to previous state (state before you merged), try
$ git branch
Experimentation
* master
pod-attempt
$ git reset --hard HEAD~24
You are done!
|
This question already has answers here:
Undo a Git merge that hasn't been pushed yet
(35 answers)
Closed 8 years ago.
I'm new Github so please forgive what may seem like an obvious question. I have an Experimentation branch which is 24 commits ahead of the master branch.
Following this tutorial, I merged the master branch with the Experimentation branch like so:
git checkout master
git merge Experimentation
(There were no merge conflicts.)
But then I realized that merging the two branches would not keep the commit history of the Experimentation branch and what I really wanted was to do a rebase (in order to keep the commit history of the Experimentation branch).
So my question is: how do I undo the merge of the master branch?
I've already tried:
$ git branch
Experimentation
* master
pod-attempt
$ git merge --abort
fatal: There is no merge to abort (MERGE_HEAD missing).
The "fatal" message confused me b/c I thought I did merge the master branch.
|
How to undo merge of master branch? [duplicate]
|
I think I found a solution to this, though it isn't ideal because I had to delete all passed builds.
I had to first copy the projects and delete the old ones to get rid of all builds that had been run.
Then I configured the default branch to be master. And I set the other branch specifications to:
+:(master)
+:refs/heads/(master)
Also, I updated the VSC trigger to listen on +:master instead of +:*.
Then I tested by manually triggering a build, and having github test hook trigger a build. It seem to have worked, they are both grouped under master!
|
Working with github and teamcity, builds seem to either be refs/heads/master or master branch.
Whenever the github service hook launches a build, it is on the branch master.
Whenever TeamCity launches a build (e.g. when I start a build, or a dependency building triggers a build) the branch is refs/heads/master.
This causes two build numbers to be shown on the same page, the last build for master and the last build for refs/heads/master.
Is there a way to make TeamCity triggered builds build master instead of refs/heads/master?
Or is there a way to get master and refs/heads/master to be treated as the same branch, not as different ones?
|
Treating 'master' and 'refs/heads/master' as the same branch in TeamCity
|
Here is a nice write up of what you are exactly looking for.
Edit: I just tested with the following steps and it works like charm!!
1. Click on repositories on the left.
2. Pull your copy of the repo from the remote , using git-shell
3. Drag and drop the Folder on to Git hub for windows dashboard.
4. now double click on the repository dropped on to githubW. It should be listed as a local repository.
5. it says login required to your non-github remote!
Credits
For some wierd reason, GutHub didn't make it straightforward to use non-GitHub Remotes. (As you said, they say that they support non-github remotes though!!)
|
Right now, I'm using msysgit to work with my own private repositories stored on a ec2 Amazon Cloud Server using SSH.
Until now, I've been able to successfully connect to those repositories through Git Bash (creating the ssh-rsa public and private key with ssh-keygen, adding the public key to the authorized_servers on the remote machine), so I can clone, push, pull, get through the CLI.
Now, I've seen Github for Windows, and I gotta say, it is a beautiful piece of software. Since it is based on msysgit, I was wondering that if it is possible to setup Github for Windows to connect, clone and push commits through the UI?
In the description it looks like possible, but the documentation seems to lacks information about what the software is capable to do.
Hope you can help me out here, cheers from Mexico.
|
Using Github for Windows to work with own private Git through SSH
|
I fought with this for 9 hours before figuring out that the underscore in the _static folder was causing the issue.
You need to bypass Jekyll on github pages.
To do this, add an empty .nojekyll to your gh-pages branch. (See example)
|
I have been trying to publish a Sphinx generated documentation for our repository on Github pages with the theme provided by readthedocs.org.
After a few attempts I managed to get it online by uploading the Sphinx generated HTML files in the gh-pages branch of the repository.
Obtaining this:
https://takeqontrol.github.io/qontrol_api/
Which is looking awful, erasing all the customization of the theme by Read the Docs.
Here is an example of what you see if you open the link:
But if I open those HTML files on my computer the pages looks exactly how I wanted them to look.
Here is an example of how exactly the same HTML looks locally:
Does anybody know what is going on? Or even point me somewhere where I can find an explanation?
All the code is available here: https://github.com/takeqontrol/qontrol_api
in the two branches.
|
Github Pages with Sphinx generated documentation not displaying HTML correctly
|
Yes, you can add, but the default name of the base file should be README.md, and later, add the URLs of different languages on the top of the README.md file so that users can switch to other languages.
Also, make sure that you add the language switch option in each of the README file so that user can switch the language back to the default which is English(I assume)
|
Is it possible to add multiple README on a git repository? To write a french and a english file for example (README.fr.md, README.en.md).
(Of course, I know it's possible but it's not recognized by GitHub as a README.)
|
Add multiple README on GitHub repo
|
Use Stylebot chrome extension
https://chrome.google.com/webstore/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha?hl=en
I use my own style for my favourite websites, I love it.
Plus point is that you can use the styles created by other peoples also. Someone might have already done the things you need there. Or else you can modify on your own.
I have few CSS rules for you,
.repository-with-sidebar .repository-content {
width: calc(100% - 50px);
}
.container {
width: 90%;
}
|
Can anyone tell me how to tell Github, that I want to see code reviews on Pull Requests in full screen width. Code lines are often longer than the area provided by Github and there is a lot of unused screen real estate.
Is there a setting in Github or a Chrome extension or Tamper Monkey or something like that.
|
Github Code Review - Full Screen Width
|
Does git-flow want me to just use regular git and do git push origin develop?
Yes, that's what you do. Simply use the regular git command.
I assume the reason for this design choice is:
The develop branch is created only once. No need for a helper command to publish it.
Feature branches get created all the time. Here, a helper command is, well..., helpful.
|
When I do git flow init it creates a master and develop branches. When I add the remote I do git remote add origin [email protected]:NewB/our-repo.git. Now I have git flow initialized on my local repo and I have the remote repo added. After I do git push -u origin master I have master in my origin but not the develop branch. Is there a git flow publish for the develop branch? All I'm seeing are publish for master0 or master1 branches. Does git-flow want me to just use regular git and do master2?
|
How to push the "develop" branch to the remote "origin"?
|
13
You can list multiple users/groups on a single line (separated by a single space) to request multiple reviews.
* @my-org/engineer-code-owners @my-org/qa-code-owners
As of time of writing, there’s no way to require a review from all code owners assigned to a pull request.
Is there any way to require all of the listed people to approve?
No, there currently isn’t a way to do that built-in to the CODEOWNERS feature.
See CODEOWNERS reference and thread on required reviews.
Share
Improve this answer
Follow
edited Mar 27, 2021 at 2:48
answered Mar 26, 2021 at 18:17
superhawk610superhawk610
2,52522 gold badges1818 silver badges2929 bronze badges
3
3
And would this allow me to require at least one review from each group?
– Brady Dowling
Mar 27, 2021 at 0:21
2
@brady-dowling unfortunately no. Updated my answer to reflect this.
– superhawk610
Mar 27, 2021 at 2:49
5
grrrrr - I wanted that too!!!
– Dean Hiller
Sep 15, 2022 at 14:09
Add a comment
|
|
I'm using the codeowners file to require PR approvals before they can be merged. What I'd like to do is:
Require all PRs to have at least one approval from a group of code owners (engineers)
Require all PRs to have at least one approval from a group of QA
It seems like the code owners file does a hierarchical thing where only one group owns the code and you can create rules for certain directories but those will just override the default code owner.
My current .github/CODEOWNERS file looks like this:
* @my-org/engineer-code-owners
Is there a way to require at least one approval from two different groups?
|
Require Github PR approvals from multiple groups
|
There are a variety of implementations that you can use, and there's a reference server implementation you can use for testing or production use.
|
I am making use of git lfs for storage of large files in a github repository. The only problem is that there is a quota for git lfs; specifically you can only store 1 GB and only stream (download) 1 GB per month. After you run out of that, you must pay $5 for 5 more GB. This could become expensive.
I have an old PC I could boot Linux and port forward on.
Does anyone know how to setup a git lfs server at home rather than using Github's lfs built in CPU's?
|
How to setup a git lfs server at home?
|
You pushed to the default push target, [email protected]. This means, that [email protected] was a remote in you source repo.
That implies, that the refs deleted from the server would still be in the remote locally after the push. Do not update the remotes (!).
Verify this by doing
git branch -a
on the side you pushed from (local).
It will probably show the refs that were deleted from the remote server.
[to be continued]
You could do something like:
for-each-ref refs/remotes/origin | while read sha type name
do
git branch "rescue_$(basename "$name")" "$sha"
done
to recover the branches locally. They will be named prefixed with rescue_ just as a precaution (in case you get funny or conflicting ref names).
Replace origin with the name of your remote
Test script
In case you want to test the procedure in a controlled environment, here is my approach condensed to minimum steps (execute in an empty dir, e.g. /tmp/work)
git init A; (cd A; touch test; git add test; git commit -m initial; git branch test1; git branch test2; git branch test3)
git clone A B
(cd B; git push --mirror origin; git branch -a)
cd A
git for-each-ref refs/remotes/origin | while read sha type name; do git branch "rescue_$(basename "$name")" "$sha"; done
git branch -a
Note how in this version, I cd into A - which would be your github repo. You could git clone --mirror [email protected]:... local_rescue in order to get a suitable local version of that.
I recommend you play around getting to terms with the procedure before trying it out. It never hurts to backup your repositories along the way.
|
On a git/github project I am working on a branch. Upon a push, it said the following:
git push
To [email protected]:...
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:...'
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.
I tried to fix this problem and upon Googleing I came up with this line:
git push --mirror
I issued the following command and now it seems that I have deleted a lot of branches from the server.
Total 0 (delta 0), reused 0 (delta 0)
To [email protected]:...
- [deleted] develop
+ 797beee...bafbc50 master -> master (forced update)
- [deleted] milestone
- [deleted] robot
- [deleted] strategy
* [new branch] origin/HEAD -> origin/HEAD
* [new branch] origin/develop -> origin/develop
* [new branch] origin/master -> origin/master
* [new branch] origin/milestone -> origin/milestone
* [new branch] origin/robot -> origin/robot
* [new branch] origin/robot_simulator -> origin/robot_simulator
* [new branch] origin/strategy -> origin/strategy
* [new branch] origin/vision -> origin/vision
Can you tell me what has happened and how can I undo the change I made? (in case I deleted those branches)
|
How to undo "git push --mirror"?
|
Yes you can, link to specific lines in a Markdown file, by going to the Blame view of the file.
Then, press y to get a permalink to the version of the file that you see now. This will ensure the link persists if the file changes, is moved, renamed or deleted.
At this point, you can click a link, or Shift+click a range of lines, and the URL will update automatically.
Here is an example link.
|
How can I create a permalink to specific lines in a .md or .Rmd file like README.md?
These files are rendered differently in github, so when I click on them I don't see the usual line-number editor where I can click on a line and ask it to give me the permalink to the selected lines, as described here.
|
How can I create a github permalink to a line in a markdown .md or .Rmd file?
|
16
Sadly there is no way to do that right now. :(
Here is a link to the Travis issue on it.
Share
Improve this answer
Follow
edited Apr 24, 2016 at 7:55
mernst
7,6733232 silver badges4747 bronze badges
answered Feb 26, 2014 at 3:24
joshua-andersonjoshua-anderson
4,47666 gold badges3636 silver badges5757 bronze badges
4
My apologies, I didn't mean to come out as harsh, I meant my response to come out as pointing out a shortcoming in a tool that is on it's way to being fixed. I also added a link to the travis issue on this.
– joshua-anderson
Mar 4, 2014 at 3:40
4
Note to viewers: Don't let the "Closed" mark on that issue confuse you. The actual issue is tracked in github.com/travis-ci/travis-ci/issues/2614
– Stefan Majewsky
Sep 14, 2015 at 7:08
3
Unfortunately, the Travis team locked the issue to prevent further comments or +1s, and haven't responded in nearly a year.
– Christopher
Jun 30, 2016 at 20:55
3
a few years now... how is this still an issue in an otherwise sweet gizmo?
– jettero
Jun 9, 2017 at 14:28
Add a comment
|
|
Travis has records for a lot of old feature branches, etc. that no longer exist in the corresponding GitHub repository, but they clutter the output of travis branches. Is there a way to prune Travis's list of branches, or at least the ones displayed by the CLI?
|
Is there a way to prune Travis's list of branches?
|
7
You can get the runner of the first job and pass it as output to the following jobs.
name: main
on:
push: { branches: [main] }
jobs:
get-runner:
name get a runner to use for this workflow
if: ${{ always() }}
runs-on: custom-runner
outputs:
RUNNER: ${{ runner.name }}
steps:
- run: echo "selected runner = ${{ runner.name }}"
other-job:
name: another job
needs: get-runner
runs-on: ${{needs.get-runner.outputs.RUNNER}}
steps:
...
This approach only works with custom runners.
Share
Improve this answer
Follow
edited Jun 22, 2023 at 7:21
answered Jun 19, 2023 at 14:46
Miguel Ángel GilMiguel Ángel Gil
9611 silver badge44 bronze badges
Add a comment
|
|
Is there any way we can run multiple jobs in a single runner or share the Github actions workspace between jobs?
In my organization, development teams use multiple reusable workflows created and managed by multiple teams. Team build creates and manages build.yaml that builds applications. My team creates and manages analysis.yaml that does data analysis on application builds and archives the built artifacts.
Developments teams are planning to use both of our workflows in their application workflow. For my team's workflow to work, my workflow needs to access the built code (target directory for maven builds, build directory for gradle builds and node_modules for npm builds).
Is there a way to run my reusable workflow on the runner where the code is built?
Is there a way I can get access to the workspace where the code is built (I searched other answers and learnt that I can use the upload action and build.yaml0 action). Are there other ways I can accomplish this and run my reusable workflow on the build runner itself?
Will I accomplish this better with a composite action rather than using a reusable workflow?
I have the following example.
build.yaml1
build.yaml2
build.yaml3
build.yaml4
build.yaml5
build.yaml6
|
Github actions: Run multiple jobs in a single runner or share workspace between jobs
|
9
I can think of 2 workarounds to this issue
create an image with all the text (Download 1.0.0 - MIN API 16)
use html for this block (ex. <table><tr><td valign="center"><img ...> text </td></tr></table>)
may not the best way, but it is an improvement :)
Share
Improve this answer
Follow
edited Oct 29, 2021 at 5:05
hazer_hazer
14611 silver badge88 bronze badges
answered Jul 25, 2017 at 8:27
Ofer SkulskyOfer Skulsky
73344 silver badges1010 bronze badges
1
1
If the image has a height of 20px, it doesn't work. It works with bigger images though.
– Matin Lotfaliee
Jun 26, 2022 at 20:30
Add a comment
|
|
How can I vertically align the image and text in the image below?
This is the way I’m writing it in my Markdown:
<a name="version"></a>[  ](https://bintray.com/edsilfer/maven/search-interface/_latestVersion) - **MIN API VERSION: 16**
|
How to vertically align elements inside GitHub Markdown?
|
I'll start by saying that we chose the 2nd solution for our production environment and I guarantee one thing - it just works. Now for the longer version:
Solution no. 1:
Simple and robust - will just work
Does not "contaminate" production servers with irrelevant files (other configuration files)
Does not load production servers with I/O to GitHub (probably negligible)
Solution no. 2:
Simple and robust - will just work
To reduce contamination, we clone the configuration repo to /tmp and delete it at the end of the playbook
Solution no. 3/4:
My guess it will work, but feels a bit strange to have your configuration in source control and then not really using source control features.
The advantage of these solutions is that you can "cherry pick" which configuration files you want to download rather than cloning the whole repository. This also reduces I/O against github as cloning becomes heavier over time.
|
Example scenario: config files for a certain service are kept under version control on a private github repo. I want to write a playbook that fetches one of these files on the remote node and puts it into the desired location.
I can think of several solutions to this:
do a checkout on the machine that runs ansible (local_action) and then use the copy module
do a checkout on the remote node (with the git module), copy the files to the desired location with command: cp src dest creates=dest (perhaps do this with a handler - only when repo has changes to be pulled)
use the url module or command: wget https://raw.github.com/repo/.../file creates=file in the playbook to only download the file of interest. Is the command module actually going to check if the file to be created is different from the one that may already exist or does it just check the file exists?
use wget on the machine that runs ansible (local_action) and then use the copy module to push it to the remote node
What are the advantages/disadvantages of these. Which (if any) of these could be considered good practice. What is the best general solution to this?
|
Using Ansible to download a single file from a private github repo to a remote host
|
5
The API docs list that you can use the parameter access_token to pass in an oauth token (not private_token or token).
Does https://raw.githubusercontent.com/ORG/REPO/master/path/to/file.json?access_token=26cb4d8a30ca2 work for you?
Share
Improve this answer
Follow
answered Oct 3, 2016 at 10:57
AzqueltAzquelt
1,4601111 silver badges1515 bronze badges
9
2
Hi. I get 404 not found. It might be that I generate the token through the personnal access token menu instead of the oAuth Applications menu. Ill report back.
– bny
Oct 3, 2016 at 11:27
nope it doesnt work. The oAuth applications menu seems to be something entirely different as it generates a clientID and a clientSecret
– bny
Oct 3, 2016 at 11:31
Bah, that's a pain, I thought it would work since the personal access token page says "Personal access tokens function like ordinary OAuth access tokens".
– Azquelt
Oct 3, 2016 at 12:16
Maybe it's because raw.githubusercontent.com is not under the API. There is an API method for getting the content, but to get the raw file, you need to request a custom media type (which you can't do through the browser) so that won't work for your either. developer.github.com/v3/repos/contents/#get-contents
– Azquelt
Oct 3, 2016 at 12:42
Yes and that is what I am investigating. I managed to access my repo through a GET request with https://api.github.com/repos/ORG/REPO/contents/README.md?ref=master&access_token=ACCESSTOKEN. Unfortunately this only gives me an answer that describes the file i.e. private_token0
– bny
Oct 3, 2016 at 13:10
|
Show 4 more comments
|
I have a private repo in my org and I need to provide access. I want to be able to access a file through a GET request (the browser). I do NOT have a terminal or curl or any other tools.
I created a dummy account that I linked to my org. I went to https://github.com/settings/tokens and added one.
Then I tried the following URLS
https://raw.githubusercontent.com/ORG/REPO/master/path/to/file.json?private_token=26cb4d8a30ca2
https://raw.githubusercontent.com/ORG/REPO/master/path/to/file.json?token=26cb4d8a30ca2
which does not work. It only seems to work with the generated token that you get when you click on "raw" on the github gui. Unfortunately this token expires quickly so it does not work for my application.
How do I access private resource on github with an access token through a URL ?
|
Github GET on private repo with access token
|
7
I'm not sure if this helps but GitHub has recently released conflict resolution on the web interface:
If you use pull requests, this will be able to help quite a lot. If you don't (bummber) then it might be an overkill to open the pull request just to see the conflict. The good thing is that unless you have complex conflicts (renamed/moved files) this will not only show the conflict but prompt you to solve it.
Hope this helps.
Share
Improve this answer
Follow
answered Dec 20, 2016 at 20:16
bitoiubitoiu
7,13355 gold badges4242 silver badges6060 bronze badges
Add a comment
|
|
I'm always having a hard time merging branches on GitHub. I admit I'm not that versed in Git CVS so I rather use visual tools like GitHub Desktop and GitHub Website to accomplish my goals.
The way I've defined our dev process is to have 3+N branches:
master - represents production environment
staging - represents staging environment
development - main development branch from where we all create feature/bug/hotfix branches
So whenever one wants to develop something, they create a branch off of development and start implementing it.
When development is done, their feature branch is then merged back into development and if all goes well, development branch is then merged into staging for testing.
I understand that since we don't do any specific testing on development branch that we could easily discard it and we'd only work with master and staging branches to accomplish for the same. Staging branch is actually being tested. Mildly, but still is.
Now I have a developer that has now created two features and each time I was merging a pull request into development I had issues merging it. The problem is I don't know how to actually see the issues on the web (comparing branches for instance) to tell the guy how to do things so I can do actual work than manage our code repo. It's frustrating at least...
So whenever I create a pull request. GitHub tells me, that I have some merge conflicts that can't be automatically resolved, but how do I see these?
Actually given my visual tools, what is the best way for me to resolve issues?
|
Is there a way to see merge conflict on GitHub by comparing branches?
|
6
You should be able to point pip at the URL of your forked repo with your bugfix because pip can install directly from git repos.
$ pip install git+git://github.com/my-username/not-mine#egg=not-mine
You can modify the pip install command to specify a particular commit, branch, tag, etc. with the "@" symbol before the "#".
$ pip install git+git://github.com/my-username/not-mine@bugfix_branch#egg=not-mine
Share
Improve this answer
Follow
answered Mar 23, 2015 at 3:47
joshua.r.smithjoshua.r.smith
91722 gold badges88 silver badges2020 bronze badges
Add a comment
|
|
Here is the example scenario.
There is a python package not-mine and I have just found a small bug in it. I find the source code on github and fork the repository. I make the necessary changes and submit a pull request. Unfortunately the package author is on vacation and I have a deadline.
I need a way to install my forked repository rather than the authors version living on PyPI. I have tried the following with no success:
install_requires = [
'not-mine==1.0.0'
],
dependency_links = [
'http://github.com/my-username/not-mine/tarball/master#egg=not-mine-1.0.0'
]
What am I missing?
Resources I have stumbled on while investigating the issue:
How can I make setuptools install a package that's not on PyPI?
|
How can I make setup tools install a github forked PyPI package?
|
5
According to github's help page max size per file is 100MB, and up to 1GB total for your repo.
Are you using LFS?
Share
Improve this answer
Follow
answered Oct 17, 2017 at 12:54
Julio Daniel ReyesJulio Daniel Reyes
5,89711 gold badge2020 silver badges2424 bronze badges
4
I have installed LFS but it seems its only for pushing out large files (greater than 150MB) which I currently don't have any large file I'm trying to push out. My github repo is already like 6GB, further research seems to indicate there is no limit to the repo size unless that 1GB implies a push limit of 1GB?
– Nonlin
Oct 17, 2017 at 12:56
3
It doesn't seem to be a hard limit, it says If your repository exceeds 1GB, you might receive a polite email from GitHub Support requesting that you reduce the size of the repository to bring it back down.. Try to split your files over multiple commits, or tracking files with LFS
– Julio Daniel Reyes
Oct 17, 2017 at 13:02
Uploading it all at once may be too heavy of a task
– Julio Daniel Reyes
Oct 17, 2017 at 13:05
Looking into the beast and easiest way to split the commits.
– Nonlin
Oct 17, 2017 at 13:07
Add a comment
|
|
Full list of info
Counting objects: 1945, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1935/1935), done.
rror: RPC failed; curl 55 SSL_write() returned SYSCALL, errno = 10053
atal: The remote end hung up unexpectedly
Writing objects: 100% (1945/1945), 3.15 GiB | 1.21 MiB/s, done.
Total 1945 (delta 231), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date
As far as I can tell, there is no file larger than 150MB, using the latest Git version. I've been able to push with no issue up until I added lots of new assets to my project (around 3GB worth) and now I get this.
What I have tried is increasing the postBuffer for both http and https to 2097152000
I should also note that I did originally have a large zip file that was not ignored (400MB) but I deleted it and made a new commit, however, this may not have been the proper way to have gotten rid of this, as I guess it will still try to push it out since the commit before the latest had it?
|
Git Push Fails with RPC failed; curl 55 SSL_write() returned SYSCALL, errno = 10053
|
2
Visiting the link: https://github.com/"your-account"/"your-repo"/branches/yours should show you what you're looking for.
Share
Improve this answer
Follow
answered May 14, 2019 at 8:58
fishyfishphilfishyfishphil
9311 silver badge66 bronze badges
1
This works for me. You can go through the list of branches and check the ones marked with a purple icon. Those are branches that have been merged but that are not deleted. You can also do it for all branches by going to all instead of yours but if it's a large repo, you could be scrolling quite a bit because there is no filter as far as I know.
– Cerno
Feb 28, 2023 at 9:26
Add a comment
|
|
After submitting a PR in Github, it gets approved and then it's merged into master. At this point I should delete my branch to keep things tidy. I'm no angel and often forget to do this!
Github has a handy Pull requests page to keep track of all your open/closed PRs. What I would like to know is, can a filter my PRs by the following:
is:pr author:myusername is:closed is:merged then something like is:branchAliveYouFool
This would show me all PRs that I've created, that are closed, that have been merged and, crucially, that haven't had the branch deleted.
I've searched through the terms that can be used but can't find what I'm looking for:
https://help.github.com/articles/searching-issues-and-pull-requests/
Any thoughts would be appreciated. Thanks :)
|
How to filter Github PRs that are merged and closed but the branch hasn't been deleted
|
1
Have you tried "Pretty R syntax highlighter" (http://www.inside-r.org/pretty-r/tool)? It might be a nice temporary fix until you get something else working.
This code:
y <- 1:10
plot(y)
gets turned into this:
`<div style="overflow:auto;"><div class="geshifilter"><pre class="r geshifilter-R" style="font-family:monospace;">y <span style=""><-</span> <span style="color: #cc66cc;">1</span><span style="">:</span><span style="color: #cc66cc;">10</span>
<a href="http://inside-r.org/r-doc/graphics/plot"><span style="color: #003399; font-weight: bold;">plot</span></a><span style="color: #009900;">(</span>y<span style="color: #009900;">)</span></pre></div></div><p><a href="http://www.inside-r.org/pretty-r" title="Created by Pretty R at inside-R.org">Created by Pretty R at inside-R.org</a></p>`
which, when imbedded in your html, displays like this:
y <- 1:10
plot(y)Created by Pretty R at inside-R.org
Share
Improve this answer
Follow
edited Jun 20, 2020 at 9:12
CommunityBot
111 silver badge
answered Jun 12, 2013 at 6:52
Marc in the boxMarc in the box
11.9k44 gold badges4848 silver badges9898 bronze badges
Add a comment
|
|
I want to publish a basic blog post like this:
(Example blog post) using my R markdown files.
But I want to publish it in Wordpress (not wordpress.com).
The most promising solution seems to be Yihui's function. I tried
that but got many errors and stop trying. I'm using Windows and it seems like Yihui's knit2wp function works stable at Linux. (I deduct this from one of the comments in his page)
Following posts did not help as well: this, this.
I tried to publish my markdown in GitHub like (this) as
mentioned in Jerom Anglim's blog post (very informative blog post BTW). Can't figure out how to embed the GitHub file into Wordpress.
I considered moving my whole blog to Jekyll as one very good example, but it
seemed very daunting to change the whole blog structure.
None of the solutions worked for me. I give up. Copying and pasting code and formatting are very inefficient. I cannot align my r output properly.
Is there any other way that I did not stumble upon and possibly solve (or ease) my problem?
Thanks in advance for any response.
|
Publishing R markdown files as blog post
|
39
I had faced same issue.
Solution:
Step 1: Control Panel
Step 2: Credential Manager
Step 3: Click Window Credentials
Step 4: In Generic Credential section ,there would be git url, edit and update username and password
Step 5: Restart Git Bash and try for clone
Share
Improve this answer
Follow
answered Oct 17, 2018 at 6:30
amoljdv06amoljdv06
2,72411 gold badge1414 silver badges1919 bronze badges
2
This works like a charm on a personal and corporate computer.
– Eduard Voiculescu
Feb 16, 2021 at 21:40
Legendary !! Worked so well.
– Shivpe_R
Feb 24, 2021 at 12:58
Add a comment
|
|
I'm just getting started with Git/Github and I'm completely stuck. I'm using Terminal on Mac/OSX El Capitan and when it asks for password it tells me it is invalid, but I am entering the same password that I created for my GitHub account, so surely this should work? What am I doing wrong?
Last login: Sun Dec 4 10:46:35 on ttys000
Seans-MBP:~ mrseanbaines$ git push -u origin master
Username for 'https://github.com': mrseanbaines
Password for 'https://[email protected]':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/mrseanbaines/cartwheeling-kitten.git/'
Seans-MBP:~ mrseanbaines$
|
remote: Invalid username or password. fatal: Authentication failed
|
I also met the same issue. I think we should change the readable permission to make sure any of the directories is readable by "all". So I tried the command: sudo chown -R $USER:admin /usr/local
and then: brew link --overwrite git It works for me, hope it will also work for you.
|
Hi I just tried installing git via homebrew on my mac - something is wrong. I had the github for mac app installed, but I tried removing that. The current git version in my system is:
Nielsk@~: $ git --version
git version 1.9.3 (Apple Git-50)
This is what happens if I try to install git via homebrew:
Nielsk@~: $ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.1.3.y
######################################################################## 100,0%
==> Pouring git-2.1.3.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
How can I solve this?
|
Install git via homebrew on mac osx 10.10 results in: Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
|
64
This worked with me
sudo chown -R $(whoami) .git/
Share
Improve this answer
Follow
answered Oct 11, 2019 at 12:49
Pablo PapalardoPablo Papalardo
1,2521111 silver badges99 bronze badges
2
It worked well. Can you please explain the logic behind it ?
– Tarun Nagpal
Jul 10, 2020 at 8:25
sudo chown=change ownership of directory, -R=make it recursive, meaning of all sub folders and files inside that directory, $(whoami)=get current logged in user, .git/=is the folder where info about git repository is stored, Hence this command will change the ownership of file to current user, so this user can perform commands like "git pull" etc.
– Hasnat Safder
Oct 27, 2020 at 4:09
Add a comment
|
|
I have CentOs. I make git and made owner's .git folders group "gitdevelopers". In group "gitdevelopers" add User1 and User2. Now i make git-push and git-pull change from user1 and user2. But users in your computers not work with error:
git.exe pull -v --no-rebase --progress "origin"
error: cannot open .git/FETCH_HEAD: Permission denied
Why?
p.s.:And i can connect to server by x-shell with login-password user1 and user2.
few hours later::
I think problem in not right login-password, which git remember.
p.p.s: where git save login-password pairs? I use ssh-protocol.
p.p.p.s.:OK. I have server CentOs with git. On server is two users. And I use TortoiseGit for windows. I configure this so : in each connect system asked login and password for connect to server. And now I wanted know : 1. where is saved this login-password 2. i can permanently saved this pair?
|
git cannot open .git/FETCH_HEAD
|
Revert locally and push your revert
git revert <commit_id>
git push upstream/master
This is better than deleting your history if you're collaborating with a team on the upstream repo. If you do hard reset and force push, you could end up removing other commits by other people. It's better to just roll back your changes and show that in the team history.
|
I am new to git. I wanted to push my data to my branch but instead I pushed it upstream/master branch. I want revert that push. Is there any way?
Any help is appreciated.
|
Git - Accidentally pushed to upstream instead of my branch
|
Try this:
cd repos
find . -maxdepth 1 -type d -exec sh -c '(cd {} && git pull)' ';'
|
I've got a folder - 'Repos' - which contains the repos that I'm interested in. These have been cloned from bitbucket, but I guess github could be a source too.
Repos
- music-app
- elephant-site
- node-demo
Is there a git command that I can use which steps thru every folder in Repos and sees if there are new commits on the server, and the download the new stuff? And if there are new commits locally, then upload these.
|
Updating all repos in a folder?
|
You have to recreate your default ssh key and use an empty passphrase. Then upload the public part again to the git server.
Without specific products you use on client and server it is a bit difficult to be more specific.
An alternative is to use ssh-agent, but I have no clue if this also works on Windows or if something similar is available.
|
Can someone point me in the direction I need look so I can configure my GIT client with the password needed for my private key? Every time I push and pull from my repository it asks me for the password for my key. I use command line and have the windows GIT client installed to use ssh.
Thanks for any pointers.
|
How do I store a password for my key so I can commit and pull from repository when using git on windows?
|
I've found this error's cause:
Someone has created another branch with the same name, but different case.
What happened?
Git for windows isn't case sensitive. So, things just got crazy! Git couldn't distinguish one from another, mistaking the hash of each's head.
Solution:
Just cut the evil by its root. Wrong remote branch was deleted and evererything is nice as ever.
|
I'm experiencing the following error while trying to git fetch a remote branch:
error: Ref refs/origin/remotes/my-branch is at some-hash but expected another-hash
From github.com:my-repository
! some-hash my-branch -> origin/my-branch (unable to update local ref)
I have no idea what the hell just blew up. Any enlightenment?
|
Git reference conflicts between branches (unable to update local branch)
|
38
Here's how to understand Git:
Forget everything you know about other VCSs (temporarily!)
Read The Git Parable. Really read it though, if you skim, you'll miss stuff and just try to fill in the gaps with your existing SCM knowledge, which is what's throwing you off. In fact, if you really want to understand, read that blog post aloud.
At its core, Git is just a way to save and restore snapshots. Each snapshot has an "ID" (the SHA1), and may have one or more "refs" (pointers) to it. A branch? Just a friendlier name for a particular snapshot. Tags? Same thing. HEAD? That's just a "pronoun" for the current snapshot. Conveniently, these snapshots each come with a description of what changed - this description is the commit message.
Share
Improve this answer
Follow
edited Mar 11, 2012 at 18:33
answered Mar 5, 2012 at 2:42
Ana BettsAna Betts
74.2k1616 gold badges142142 silver badges209209 bronze badges
2
Terrific reference reading, Paul. This helps get one's arms around the gist of Git. Thank you.
– Vallynn
Jun 11, 2012 at 15:19
The Git Parable doesn't seem to mention forks at all... what are forks really?
– dokaspar
Dec 11, 2019 at 6:45
Add a comment
|
|
I've been using Github for sometime now but I'm getting a bit confused about some key concepts behind Git.
My background with VCS started with Source Safe and then transitioned into SVN and TFS. I think I'm stuck in the old way of thinking of CVS system, like SVN and TFS.
What is considered server-side and client-side in Git. From what I've understood there isn't a clear distinction between them.
In a technical sense, what does a Fork mean. Is it a "type" of branch?
Wat does a branch mean in git? Is it the same as in SVN?
Also I've been looking for a good visualization of the core concepts of Git, but haven't found any one that works for me.
|
What are the core concepts of git, github, fork & branch. How does git compare to SVN?
|
That's basically correct, yes. To explain what each thing is doing...
git init basically says, "Hey, I want a repository here." You only will have to do this once per repository.
After that, you will want to add a remote, which GitHub probably told you to do by using git remote add origin [email protected]:username/repository This allows you to push to a remote. You will only have to do this once as well.
After that, use git add to add your changes, or "stage them". You can use git add -i for a bit of a more interactive experience.
Use git commit -m 'message' to commit locally.
Then use git push origin master This says, "Push all of the commits to the remote origin, under master.
If you make changes from another machine, or someone else makes changes, you can use git pull to get them from the remote.
You might want to consider reading ProGit - it's free online and is a wealth of information. There you can learn more about features like branching, merging, etc.
|
So:
1) I have created my account on github and I've created a repository there.
2) I have the keys to access the repository from my dev machine to github, using SSH, so that my local repository is synchronized with the remote one hosted on github once I do, push or pull.
But, I'm not understanding how will all this start.
I have my local files on this dev computer and from there I do:
3) git init
then
4) git add
and then I 5) commit that project to my LOCAL repository.
Once this is done, then I will 6) push this to github repository.
Is this correct?
|
How do I start using my repository locally and on Github?
|
GitHub for Windows only supports one remote for now (origin, which reference your fork).
So you need to manually add a remote (called 'upstream') referencing the original repo, in order for you to be able to pull (from the CLI) from upstream, updating your local repo and allowing you to push (this time with the GUI) the new commits to your fork.
See "What is the difference between origin and upstream in github" for more.
|
I am currently using the Windows Github GUI and its pretty cool looking and easy so I'm trying to use it as often. A problem I encountered is when I fork a project I don't know how to update that fork with the git
|
update fork on GitHub for Windows?
|
Fixing via merge:
git fetch origin # gets latest changes made to master
git checkout feature # switch to your feature branch
git merge master # merge with master
# resolve any merge conflicts here
git push origin feature # push branch and update the pull request
Fixing via rebase:
git fetch origin # gets latest changes made to master
git checkout feature # switch to your feature branch
git rebase master # rebase your branch on master
# complete the rebase, fix merge conflicts, etc.
git push --force origin feature
Note carefully that the --force option on the push after rebasing is probably required as the rebase effectively rewrites the feature branch. This means that you need to overwrite your old branch in GitHub by force pushing.
Regardless of whether you do a merge or a rebase, afterwards the conflicts should be resolved and your reviewer should be able to complete the pull request.
|
I have to make a pull request to a repo.
I clone the project and it has only one branch : master
I checkout a new branch feature and commit my changes to this branch.
I push my branch to Github and I'm now able to make a pull request. So I do it but it tells me now that I have conflicts.
I understand the problem. master is ahead of feature because I didn't "pull" the last changes that have been made to master when I waas working on feature.
How can I fix it ? How can I "pull" the last changes of master into my feature branch ?
|
Git - Fixing conflict between master and feature branch before pull request
|
I had this problem on Mac OS X Yosemite with ruby 2.3.1.
I fixed the problem by downloading http://curl.haxx.se/ca/cacert.pem to
/usr/local/etc/openssl/
and adding this line export SSL_CERT_FILE=/usr/local/etc/openssl/cacert.pem to .bash_profile
Credit to Can't run Ruby 2.2.3 with RVM on OSX but it was hard to google the right answer, so added to this page.
|
I'm getting this error when I run bundle install:
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely
your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using
SSL, edit your Gemfile sources and change 'https' to 'http'.
However, it is only happening to one of my projects, and seems to be happening to only me. Also, I can get around it by running bundle update, where I don't get that error, and I can get up a running after that.
Is there something that isn't tracked in the project (that is only on my machine) that I have misconfigured?
|
Could not verify the SSL certificate for https://rubygems.org/
|
37
You can change the date of last commit:
git commit --amend --no-edit --date=now
or input date:
git commit --amend --no-edit --date="2020.11.02 12:00"
Share
Improve this answer
Follow
answered Nov 2, 2020 at 13:31
JackkobecJackkobec
6,2113939 silver badges3535 bronze badges
3
3
Thanks .This does not change the date in my github repo profile.It does change the date of the commit in my local repo.I am looking for a way to have the change show up once I push the code upstream.
– Aliman
Nov 2, 2020 at 14:07
1
This does not change the date of the last commit. It creates a new commit that has the same underlying tree.
– William Pursell
Sep 4, 2021 at 12:10
Yes, do you have some alternatives?
– Jackkobec
Sep 4, 2021 at 16:14
Add a comment
|
|
I need to push some code upstream into my repo. However I would like to see if It is possible to set the date of the commit/push to be something other than the current the date.This would mean if someone visited my github page and my desired date for the push was 00/00/00 it would show as 00/00/00 and NOT the current date.Is there anyway to do this?
|
How Can I change the date of a git commit
|
I need to track new tags of many projects on github [...] through RSS channel
GitHub provides an atom feed for tags
Syntax: https://github.com/{:user}/{:repository}/tags.atom
Example: https://github.com/libgit2/libgit2sharp/tags.atom will list the tags of the LibGit2Sharp project
|
I need to track new tags of many projects on github, it's possbile to get emails about newly created tags? Or through RSS channel, or somehow be notified, when new tag is created.
I think that this would be great feature how to track new versions of projects hosted on github.
|
Watching new tags on GitHub
|
If branch B is at local, You can merge A to B locally and push B to remote:
git checkout B
git merge A
git push origin B
If you don't have B at local, you can push A to remote and pull request to merge A to B and click merge button on github.
or, fetch B branch to local and merge A to B , then push B to remote, like this:
git checkout master
git fetch origin B:B (fetch B to local)
git checkout B (checkout to branch B)
git merge A (merge A to B)
git push origin B (push merged branch B to remote)
|
I have a local branch A that doesn't exist yet in the remote repo. I also have a remote branch B in the remote repo. How do I merge my local changes into the remote branch?
|
Merge local branch into remote branch other than master?
|
23
Iterating through a user's repositories is sub-optimal because it misses any commits they make in other repositories. A better way is to use the Events API instead.
The first step is to get the user's events:
GET /users/:username/events
Next you need to iterate through the returned events, checking for items where result.type is set to PushEvent. Each one of these corresponds to a git push by the user and the commits from that push are available (in reverse chronological order) as result.payload.commits.
You can filter those to ignore any commits made by other users, by checking that commit.author.email matches what you expect. You also have access to properties like sha, message and url on that object, and you can eliminate duplicate commits across multiple pushes using the distinct property.
Overall there is more legwork involved, but it also gives you a far more accurate representation of what a user has actually committed.
In case it helps, here's some example code taken from my website, which uses the above approach to fetch the last commit for a user (implemented using Node.js and the result.type0 npm module):
result.type1
Share
Improve this answer
Follow
edited Jun 6, 2018 at 8:07
answered May 31, 2016 at 19:58
Phil BoothPhil Booth
4,86311 gold badge3434 silver badges3535 bronze badges
1
1
Unfortunately this only shows events within the last 90 days: docs.github.com/en/rest/reference/activity#list-public-events > Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).
– jyn
May 27, 2021 at 17:32
Add a comment
|
|
I'm trying to build a method in which I can access a Github user name, and publish either all commits or at least a number of commits from that user.
Is there a call to GET user/repo/commit association or a direct user/commit?
Right now, I think what it will take is the following:
Obtain repos associated with a particular name:
api.github.com/users/:name/repos.
From feed obtain repo name.
Place repo names in an array, such as:
api.github.com/repos/:user/:repo1/commits
api.github.com/repos/:user/:repo2/commits
api.github.com/repos/:user/:repo3/commits
From feeds, obtain the number count of shas?
|
Github API - retrieve user commits?
|
If this is your composer.json
"require": {
"torophp/torophp": "dev-master"
}
and you want to change it and use your fork instead, just add your repository into composer.json as follows:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/your-github-username/torophp"
}
]
Important: Do not change the "require" part, it must continue using torophp/torophp!
After adding the "repositories" part, run a composer update (or composer.phar update) and composer will then download your fork (even though it echoes "installing torophp/torophp" during the operation).
Update (18.09.2014): As mentioned by @efesaid in the comments:
If your package is published on packagist, you need to add
--prefer-source option to force installation from VCS.
Note: For those having issues with pulling from the HTTP(S) source (ie you get "require": {
"torophp/torophp": "dev-master"
}
0 when trying to update), you can change the "require": {
"torophp/torophp": "dev-master"
}
1 to use the git protocol instead. To do so, change the "require": {
"torophp/torophp": "dev-master"
}
2 as follows and run "require": {
"torophp/torophp": "dev-master"
}
3 again.
"require": {
"torophp/torophp": "dev-master"
}
4
Now go into "require": {
"torophp/torophp": "dev-master"
}
5 and run "require": {
"torophp/torophp": "dev-master"
}
6 for a double check that you use the desired source for the repository.
From there you can commit the changes to your fork and update it from origin ("require": {
"torophp/torophp": "dev-master"
}
7).
Update: To work with private repositories at GitHub, you must use git protocol and also must have installed SSH keys for a git client.
Composer reference: Loading a package from a VCS repository
|
I pull in a package using Composer with this composer.json:
{
"require": {
"torophp/torophp": "dev-master",
},
}
When I run composer install it seems to pull this package from GitHub directly.
I have created a fork of that repo on github with some small changes. Is there a way I can get composer to pull my version on GitHub instead of the original?
|
Change Composer git source for a package
|
git reset -- FILE_NAME will do it.
See the git reset manual:
This means that git reset <pathspec> is the opposite of git add <pathspec>
|
After I made changes on a file. I use git add FILE_NAME.
Then, I would like to revert it as not added but meanwhile keep the changes, how to do this?
|
GIT add revert in my case (keep changes)
|
Enter this command in a prompt:
git config --global core.editor "C:/Program Files/Sublime Text 2/sublime_text.exe"
It will then pop up when prompted for a commit message, or any other edition task, but if it was already open it won't work since it uses the same instance. Don't know how to workaround this.
|
So I'm trying to set up GitHub for the first time ever and I want Sublime Text to be my core editor, how exactly do I do that? Sorry if this is a noob question, I am a noob :/
|
What is the command to make Sublime Text my core editor?
|
No, that's not quite correct. It depends somewhat on which version control software you're using, but I like Git so I'll talk about that.
Suppose we have a file Foo.java:
class Foo {
public void printAWittyMessage() {
// TODO: Be witty
}
}
Alice and Bob both modify the file. Alice does this:
class Foo {
public void printAWittyMessage() {
System.out.println("Alice is the coolest");
}
}
and Bob does this:
class Foo {
public void printAWittyMessage() {
System.out.println("Alice is teh suk");
}
}
Alice checks her version in first. When Bob attempts to check his in, Git will warn him that there is a conflict and won't allow the commit to be pushed into the main repository. Bob has to update his local repository and fix the conflict. He'll get something like this:
class Foo {
public void printAWittyMessage() {
<<<<< HEAD:<some git nonsense>
System.out.println("Alice is the coolest");
=====
System.out.println("Alice is teh suk");
>>>>> blahdeblahdeblah:<some more git nonsense>
}
}
The <<<<<, ===== and >>>>> markers show which lines were changed simultaneously. Bob must resolve the conflict in some sensible way, remove the markers, and commit the result.
So what eventually lives in the repository is:
Original version -> Alice's version -> Bob's conflict-fixed version.
To summarise: the first to commit gets in without any problems, the second to commit must resolve the conflict before getting into the repository. You should never end up with someone's changes being clobbered automatically. Obviously Bob can resolve the conflict incorrectly but the beauty of version control is that you can roll back the incorrect fix and repair it.
|
I believe the title says it. I'm new to source control thingy.
So, let's say I have two developers working on the same project and they started editing the same file(s) at the same time then everyone of them send the new version at a slightly different time. From what I understand the one who sends the changes last will have his changes kept, the other one's code will be in the archive only!!!
Is that correct?
Please clarify. Thanks.
|
How two people, concurrently editing the same file is handled?
|
First, check wheter you have master role in the repository/Group. Developer or any other role cannot delete the project/forked project.
If you are master then
Go to settings
Go to Advanced settings.
Click on remove project.
Type the project name and click confirm
|
I forked a project to a group. But there is no option to delete that forked project. I saw danger zone in Github. Is there any option available to delete forked project from Gitlab?
|
How to remove a forked project in Gitlab
|
The git SCM resource is probably what you're looking for. Simple resource usage example:
git "/path/to/check/out/to" do
repository "git://github.com/opscode/chef.git"
reference "master"
action :sync
end
Also see "revision" attribute if you want to grab a specific branch.
|
I have a Git repository I would like to check out onto a server. Is there a Chef recipe that does that?
|
Check out a Git repository with chef?
|
For pull request events the ref and sha for the base can be found in the github context as follows.
${{ github.event.pull_request.base.ref }}
${{ github.event.pull_request.base.sha }}
For push events there are base_ref and before parameters.
${{ github.event.base_ref }}
${{ github.event.before }}
before is the last git sha pushed to origin on branch base_ref. Note that if this is the first commit on a new branch, base_ref and before will have null/default values as shown below.
##[debug] "event": {
##[debug] "after": "727f7aec97c394083d769029e5f619e9b094a235",
##[debug] "base_ref": null,
##[debug] "before": "0000000000000000000000000000000000000000",
...
By the way, you can dump the github context and check the available parameters by adding this step to your workflow:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
|
I'm using Nx for monorepo support on a new project. One of the benefits of Nx is that it can determine which apps in the monorepo are affected by a range of changes (start commit, end commit). So if you have a bunch of apps, you only have to build, test, and deploy the apps that are actually affected by the changes instead of the entire monorepo.
I'd like to setup a GitHub Action workflow to deploy only the affected apps on push or merge to master. However, I'm having trouble figuring out how to get the "start commit" for the range of changes. In other words, how do I get the commit hash of the last deploy?
GitHub provides an env variable GITHUB_SHA but that's the commit that triggered the workflow (i.e. the "end commit"). It also provides GITHUB_BASE_REF but that only works on workflows running from a forked repo comparing to the head repo.
CircleCI has pipeline.git.base_revision for this purpose. Do GitHub Actions have something similar?
|
How can I get the previous commit before a push or merge in GitHub Action workflow?
|
31
I'm the developer who put this in. Here's why I added this to the system gitconfig, it's pretty useful!
## Because of this change, git fetch knows about PRs
git fetch
## Now, I can merge PRs by number
git merge origin/pr/24
## See changes from PR #53
git diff master...origin/pr/53
## Get the commit log from PR #25
git log origin/pr/25
Unfortunately, this does have the consequence that the origin remote always exists, even when it doesn't.
Workaround
Whenever you see git remote add origin https://..., instead:
git remote set-url origin https://...
Share
Improve this answer
Follow
edited Oct 10, 2013 at 16:18
answered Oct 10, 2013 at 16:07
Ana BettsAna Betts
74.2k1616 gold badges142142 silver badges209209 bronze badges
3
@Paul Does this mean the manual setup outlined in Checking out Pull Requests locally at GitHub Help is no longer necessary with this new feature? (I tried git checkout pr/999 without doing anything to my .git/config and it worked.)
– Daniel Liuzzi
Oct 28, 2013 at 11:14
After reading Chad's answer and its comments, I went to check my ~\AppData\Local\GitHub\PortableGit_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\etc\gitconfig and, sure enough, the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* was there. So, to answer my own question: yes, newer versions of GHfW come with git checkout pr/999 functionality baked in at the system level, so it is no longer necessary to do any manual configuration to checkout pull requests locally.
– Daniel Liuzzi
Oct 29, 2013 at 11:02
I just loved the first line :)
– DollarAkshay
Sep 11, 2014 at 17:30
Add a comment
|
|
I installed Git for Windows, although I am using the shell not the Windows interface.
If I do a git init, and then try and do a
git remote add origin [email protected]:someuser/testme.git
I get the following error
fatal: remote origin already exists.
So I do a
git remote -v
and it returns the following
origin
upstream
So it appears its there but has no URL set, I don't understand why it's there?
If I do a
git remote rm origin
it produces this
error: Could not remove config section 'remote.origin'
It says that it can't remove the remote.origin config section; I checked the .gitconfig under my home directory and I don't see anything.
Anyway I was able to remedy this by using
git remote set-url origin [email protected]:someuser/testme.git
But I am getting confused as I have used Git before and this never happened.
Could this be something to do with Git for Windows?
|
Git: says origin already exists on "NEW" (init) repository, using shell but installed Github for Windows
|
To understand what happens
Reference: Github community post with the weide-zhou (Github Partner) answer.
When you can create a pull request, github will execute workflow based
on a fake merge branch: refs/pull/:prNumber/merge, the
merge_commit_sha doesn’t exist on base or head branch, but points to
that surrogate merge commit, and there is a mergeable key to show the
status of the test commit.
Therefore, here, the github.sha stands for the actual merge commit.
Github Variables
Tip: you can print the GitHub variables using the following step:
- name: Show GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
It seems that what you want here is the ${{ github.event.pull_request.head.sha }} value.
In the case of pull_request, the hash of the latest commit can be found in the ${{ github.event.pull_request.head.sha }} variable, whereas ${{ github.sha }} refers to the PR merge commit.
Note that if the pull_request has been opened for a fork repo, the github.event.pull_request variable will be empty (don't know if it's a bug or something they are working on).
|
In a Github action you can get the commit SHA using ${GITHUB_SHA}, which is a default env variable.. However, this commit SHA seems to be a merge commit!? which does not equal the commit SHA displayed on PR's Github UI. Any thoughts on how I can get the SHA that is displayed in PRs (on Github UI)?
|
Get commit SHA in Github actions
|
Github pages uses a version of Jekyll that ignores node_modules folder by default.
According to this blog article. You can do the following:
Create an empty .nojekyll text file in the root of the gh-pages branch.
You can also refer to this announcement by github which talks about the update that is responsible for this behavior.
|
I am trying to render my GitHub repo on the Publisher-Subscriber module with JavaScript using GitHub pages. The gh-pages branch looks fine. However, the mustache code does not render on my project on GitHub Pages. It looks like this :
GitHub Repository : https://github.com/ajhalthor/pubsub-application
Github Pages Repo for this project : https://ajhalthor.github.io/pubsub-application/
The GitHub Repository also has the node_modules folder, so it should be self sufficient. Mustache, jQuery & Bootstrap are included in this folder, so there are no external links or CDNs.
Main Question : Why isn't mustache rendering even though all paths are specified relative to the project's main folder?
|
Github Pages 404 on node_modules folder
|
Answering a very old thread, here, but I'm on Cygwin and just had to do this to start work with my newly created site on phpfog.com
First, I ran this in cygwin:
exec ssh-agent bash
ssh-add ~/.ssh/private-key-name
I then received:
Identity added: /home/scott/.ssh/private-key-name (/home/scott/.ssh/private-key-name)
|
I am trying to clone a git repo that I forked in my GitHub Repository.It's a rails app. I want to clone it on my local git so that I can push it onto heroku. I generated a set of rsa keys and copied it onto my GitHUb public keys. When I try to git clone "public url" , It says public key denied. I tried an ssh [email protected] to verify my key, it also says public key denied. I've tried several different things to make it work but it still hasn't. I tried to change permissions to 600 and 700 on my .ssh folder. I also tried adding a dsa key because the rsa won't work. please help me. Thanks. :)
I'm on Vista btw.
|
SSH Public key denied on "git clone" command
|
39
UPDATE:
This is how you do it in a Github Native way:
Install the Github Slack app
Go to your settings/reminders
Select the org you care about
click Enable real-time alerts
select You are mentioned in a comment
While it doesn't seem like github's slack app will do what you're asking for yet (track this issue for future updates), But I've found 2 alternatives:
this example using pipedream integrations.
The good news is that pipedream is free, but the bad news is that pipedream is free.
Using PullReminders's pullpanda as explained in this comment (unclear if still functional after GitHub acquired the company behind PullReminders, though). If this works, it should be free.
You won't have to pay, but I have no idea about the security aspects of integrating with a free 3rd party that has no commitment or clear incentive to keep your system secure.
Share
Improve this answer
Follow
edited Aug 20, 2020 at 19:15
answered Aug 20, 2020 at 18:39
Joey BaruchJoey Baruch
4,58066 gold badges3636 silver badges5252 bronze badges
2
It does seem like this is buggy or incomplete - I added a comment in the files view of a random commit (example below), and I was not notified Can anyone inform people in GH? github.com/google/googletest/commit/…
– Joey Baruch
Aug 20, 2020 at 19:55
1
If anyone is interested, PullReminders was shut down 4 years ago. I developed with a friend an alternative: axolo.co it helps tech teams review PR in Slack by creating ephemeral channels and inviting the right people instead of notifying the whole team/repo
– acoudouy
Jan 17 at 9:35
Add a comment
|
|
Zapier has a very cool feature you can add which will send a slack notification every time you are mentioned on github.
https://zapier.com/apps/github/integrations/slack/1596/send-a-github-new-mention-to-slack-as-a-new-message
Unfortunately it is not a free service. Does anyone have a way to add this kind of integration directly with slack or something else? It would be really useful for my work environment.
|
Get a slack notification if mentioned on Github
|
There are a couple different ways but I’ll go over what I would do in this situation
git remote add <whatever you want the remote to be called> <link to the fork>
Here is the documentation. This will allow you to add and check out the remote branch from the fork. When reviewing PRs in the workflow you described I usually do a git clean -dfx (warning: this is a very intensive clean that gets rid of unstaged work you have), git remote add <whatever you want the remote to be called> <link to the fork>, and git checkout <branch name>.
If it’s in your repo already you can see that with git branch -a and simply check it out as you might otherwise.
|
I'm using GitHub to host some projects and someone forked my repo and submitted a PR. I have never had to test a PR in a fork before. How can I checkout the branch and test it? Can I some how pull it into my repo? Or do I checkout the fork and test the branch that way?
|
How do I checkout a PR from a fork?
|
29
To ignore all files from a particular directory when computing statistics, you can use the following .gitattributes:
your/framework/directory/* linguist-vendored
If you think your framework is common enough through github.com, you can make a pull request to Linguist to add it to the list of ignored directories. That way, you won't need to ignore it on a per-repository basis.
Share
Improve this answer
Follow
answered Aug 13, 2017 at 7:13
pchaignopchaigno
12.1k22 gold badges3333 silver badges6060 bronze badges
Add a comment
|
|
I am currently creating a lot of small experimental game projects in Lua that include a framework written in C, which dominates the code percentages and declares my project as being in C when it is not.
I do however want to keep this framework, as it allows me to add on the playable version of the game.
I am partially familiar with the concept of removing language statistics on a file, but is there a way to omit a directory?
I have also seen most answers link to this answer but as I am new to github I don't quite know how to decipher it.
|
Is there a way to ignore calculating language statistics for a directory on Github?
|
Check if this is related to actions/runner issue 1039
Seems like GITHUB_TOKEN works only on default branch... You need to use custom PAT when running on PR branches
Check also if this is similar to this discussion:
It turns out another org member had pushed the same package, which was private by default and was owned by that org member.
Since nobody else could even see the package as existing, we were very confused.
I think this default behavior of new packages being privately owned by the user uploading and not being visible to even the org owners is quite confusing.
If not, try, as described here, to do the push manually, in order to validate your token (with a docker login -u USERNAME -p TOKEN ghcr.io, then a docker push). The GitHub action might then work.
|
I have a Github organization and try to migrate container registry from docker hub to GitHub Packages. By using Github Workflows, here's the yaml I used to push docker to GitHub Packages:
name: ghcr_test
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
GitHub recommends using GITHUB_TOKEN in action workflows, I'm already double check it has read and write permission in my organization settings, but they gave me this error
Error: buildx failed with: error: denied: permission_denied: write_package
Any help?
|
GITHUB_TOKEN permission denied write package when build and push docker in github workflows
|
You can add rules to your branches and how your merge request works.
Your repo -> Settings -> branches -> Branch protection rules -> Add rule
There, you will find something called Require status checks to pass before merging. Under this, you should see Status checks found in the last week for this repository. If you find the status you want to be passed before merging, you can enable the same.
Docs: https://help.github.com/en/github/administering-a-repository/defining-the-mergeability-of-pull-requests
|
I am using a commitlint Github action to verify our commit messages. Just wanted to check if there is a way I can make it mandatory to pass before merging pull request.
current behaviour:
commitlint github action fails, however, I can still merge the pull reqest
desired behaviour
if commitlint github action fails, button to merge pull request should be disabled. (i.e. like reviewer restriction)
|
Github Actions: is there a way to make it mandatory for pull request to merge
|
It's simple and can be done by two command lines:
git checkout sprint
git merge origin/master
This will merge the remote master branch to the local sprint branch. So your local sprint branch is up to date like the master branch.
If you need to do this on Github.com, then create a PR(Pull Request) and then select two branches(base:sprint and compare:master) and then merge it.
|
I have a Sprint branch that was created prior to new updates on Master. Since then, the changes were pushed to the master branch, now I have to update the Sprint branch. I am trying to sync my Sprint branch with a master.
Is there a way to do it through github.com page, otherwise I am using PhpStorm VCS.
|
How to update a branch with master on GitHub
|
Yeah, there is a button on the right to hide that:
|
It's kind of a weird one - I have several organisations under my GitHub account and some, under the Overview tab display the list of repositories, wheres others a list of different options under the heading We think you’re gonna like it here.. I don't think I've done anything different when setting each organisation, but does anyone know how to replace the
with list of repositories like under this organisation?
|
GitHub organisation overview tab: how to display list of repositories
|
34
git submodule remains the recommended way: you can declare (git submodule add) a repo which doesn't belong to you, or a fork (which, by definition, belongs to you).
Don't forget though, that:
you still need to git submodule update --init in order to see that submodule repo being displayed with its full content in your repo
add and commit the special entry representing the root directory of that submodule in your main (parent) repo, and push that commit, in order to validate that declaration.
Share
Improve this answer
Follow
edited May 23, 2017 at 11:54
CommunityBot
111 silver badge
answered Jul 21, 2013 at 20:18
VonCVonC
1.3m539539 gold badges4.6k4.6k silver badges5.4k5.4k bronze badges
1
2
This answer is generalized for Git. The OP asked about GitHub, which presumably uses its own client.
– ATL_DEV
Oct 26, 2017 at 14:47
Add a comment
|
|
I'm new to github.
I have a github repo on my machine. I want to include another repo (as a third party) into my repo. I believe I should make a fork first. But how do I include it on my local repo?
I've tried submodules but with no success...
Thanks.
|
GitHub include from another repository
|
After contacting GitHub support, they told me that the issue reference will only be seen by the people who have access to that private project.
Any other members will not see the comment or message @amitpchigadani amitpchigadani referenced this issue in MyOrganisation/projectName. I was somewhere worried about the privacy concerns, but this seems to be fine.
Note : Issue once referenced, message/comment cannot be removed there after.
|
I was trying to refer some issue from public library within my github project issue. What I did is I was commenting on one of the issues listed in my project and I gave the reference to the actual issue listed out in public library.
example : https://github.com/public-library/issues/42
And when I click that link it says : @amitpchigadani amitpchigadani referenced this issue in MyOrganisation/projectName an hour ago.
But I want to remove that reference from the public library. Is it possible to do it now?
Note : I removed the reference later and checked, but that comment/alert still exist in public library issue.
|
Remove issue reference in GitHub
|
Changing the name of the root folder from VL to html shall be no problem since git only works on the directories below that level.
So, what's left is introducing the folder VL below the html folder and move all code files there:
mkdir VL
git mv <all your code> VL
git commit -m "moved all my code under VL"
Using git mv you tell git that you moved things, so it could still keep track of the history.
Edit:
As Benjol notes in his comment, using git mv is not neccessary. You could achieve the same by copying <all your code> to VL, then do
html0
html1
html2
git is smart enough to recognize the movement.
|
I want to somehow change the git directory structure. Currently the architecture is like
VL(repo)
.git (hidden)
code files
......
.....
I want it like
html(repo)
.git
VL
code files
......
......
I had a solution to archive the current repo and then create the new repo with above structure. But the bad thing about this approach is that it removes all previous history. is there any better solution?
|
changing the git structure
|
You need to update git. See here: The last comment from Whoisj. I had the same problem in the morning. It's easy: just download and install git again. See for example here
|
This question already has answers here:
Git pull / push - unable to access HTTPS, SSL routines seem to be down
(19 answers)
Closed 6 years ago.
I am using a github Repo for almost one year and since this morning I am not able to push my code to the remote repo. I get following error in the command line:
fatal: AggregateException encountered. Mindestens ein Fehler ist aufgetreten.
The credentials.log contains following error:
System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> System.Net.Http.HttpRequestException: Fehler beim Senden der Anforderung. ---> System.Net.WebException: Die Anfrage wurde abgebrochen: Es konnte kein geschützter SSL/TLS-Kanal erstellt werden..
Apparently, yesterday were some releases. See here for more information: https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/
Maybe, this could be the reason, but I don't know how to solve it. Can you help me please? I use Windows 10.
|
Github Access Error - AggregateException encountered [duplicate]
|
I achieved this by putting is:issue involves:my-username in GitHub search.
This chapter from official docs can be really helpful GitHub Help: Searching issues and pull requests.
|
github only list top several issues I posted or commented, so I'm wondering how to search for the rest of them myself, of all issues that I myself participated.
|
github, how to search issues I posted or commented
|
grr...
The problem got fixed after restarting my Mac computer.
|
I have been trying to push new changes to my existing repo, however, I am keep getting the following error:
-MacBook-Pro:spa $ git push origin master Username for XX Password for fatal: unable to access 'https://github.com/XXXX/': Empty reply from
server
I have even tried with the new repo but the result is same.
|
gits error on push Empty reply from server
|
You cannot hide what you've starred on GitHub. Once it's starred, it's out there.
|
How can I hide my starred items from other people in github?
I am not interested in sharing starred items with followers.
I checked github preferences but not found anything relevant.
|
Hide starred items in github
|
Cloning a repo won't duplicate all the remote branches on the local repo: for a large remote repo with a lot of branches, that would pollute your local namespace with tons of branches.
I have a one-liner command in order to create local branches tracking all the remote branches of a remote repo, but this is usually not needed.
You only create a local branch tracking a remote one when needed.
git checkout -b aBranch --track origin/aBranch
# or, shorter:
$ git checkout --track origin/aBranch
Branch aBranch set up to track remote branch refs/remotes/origin/aBranch.
Switched to a new branch "aBranch"
# even shorter at the end of this answer.
Adding a --track allows for setting up the configuration to mark the start-point branch as "upstream" from the new branch.
This configuration will tell git to show the relationship between the two branches in git status and git branch -v.
Furthermore, it directs git pull without arguments to pull from the upstream when the new branch is checked out.
kostix mentions that --track is implied when forking a branch off a remote branch (unless branch.autosetupmerge is set to false)
This could be enough
git checkout aBranch
The exact explanation from git checkout man page is:
If <branch> is not found but there does exist a tracking branch in exactly one remote (call it --track0) with a matching name, treat as equivalent to:
--track1
|
I forked a repo from Github. On doing git remote -v it displays:
origin https://github.com/myusername/moodle.git (fetch)
origin https://github.com/myusername/moodle.git (push)
upstream https://github.com/moodle/moodle.git (fetch)
upstream https://github.com/moodle/moodle.git (push)
The moodle.git has about 10 branches, but the repo shows only 2 of them. On doing git branch -a (show all branches) I get:
MOODLE_24_STABLE// just these two on local..how?
* master//
origin/MOODLE_13_STABLE
origin/MOODLE_14_STABLE
origin/MOODLE_15_STABLE
origin/MOODLE_16_STABLE
origin/MOODLE_17_STABLE
origin/MOODLE_18_STABLE
origin/MOODLE_19_STABLE
origin/MOODLE_20_STABLE
origin/MOODLE_21_STABLE
origin/MOODLE_22_STABLE
origin/MOODLE_23_STABLE
origin/MOODLE_24_STABLE
origin/master
upstream/MOODLE_13_STABLE
upstream/MOODLE_14_STABLE
upstream/MOODLE_15_STABLE
upstream/MOODLE_16_STABLE
upstream/MOODLE_17_STABLE
upstream/MOODLE_18_STABLE
upstream/MOODLE_19_STABLE
upstream/MOODLE_20_STABLE
upstream/MOODLE_21_STABLE
upstream/MOODLE_22_STABLE
upstream/MOODLE_23_STABLE
upstream/MOODLE_24_STABLE
upstream/master
How do I resolve my problem without any loss of data or any irregularities?
|
Git is not showing all branches on local
|
You can use git hooks for that.
The pre-commit hook specifically. You can create one from the sample in .git/hooks/pre-commit.sample by removing the .sample suffix and editing it. The content of pre-commit will be executed just before the commit.
It could contain something like this
#!/bin/sh
command-that-increases-version version.text
git add version.text
Any modification of version.text will then be included in the commit.
Finally some advice: you may want to avoid doing this altogether, since it may lead to a lot of merge conflicts when different branches store different values in version.text.
|
We have our master branch that we merge our features into. I need to be able to increment our version on commit/merge to the master automatically as a part of the merge. Is there a way i can do this so that the upped version is committed as a part of this commit without having to have an automatic 're checkout, change, commit' that will effectively double all our commits?
|
Change version file automatically on commit with git
|
18
Your workflow does not sound correct based on the details in your question.
If you have pushed your Jekyll-based site to a username.github.io repository, then you do not need a gh-pages branch. A gh-pages branch is only required for repositories where you want to have code and a website in the same repository. GitHub Pages will take care of running Jekyll for you and serving the compiled site in both cases.
GitHub Pages does run Jekyll in a very specific manner in order to keep it safe. If you're using custom plugins with your Jekyll site, then you'll need to store your compiled site (the _site directory you mentioned) on the master branch, and the source in a different branch.
To summarize, your workflow should be work in your local repository - either in the master branch or feature branches (merging the feature branches to your local master branch as needed) - and when you're ready to publish, push your local repository to the master branch on GitHub.
Share
Improve this answer
Follow
edited Jan 8, 2014 at 1:45
answered Mar 5, 2013 at 22:41
mattr-mattr-
5,56322 gold badges2424 silver badges2828 bronze badges
Add a comment
|
|
I have built a site locally with Jekyll, and have pushed it to a new master repo (username.github.com) and the site works great yay. My question is, how do I move just the deployable part, the _site directory, into a gh-pages branch? Or rather, the contents of that directory if that is the best way to deploy?
I plan on using a custom domain. My workflow will be to work in the master branch, maybe some feature branches, and then push (merge) the compiled outcome into the gh-pages branch. Does that sound correct?
I am having a tough time figuring it out via documentation, would appreciate any help, thank you!
|
Deploying Jekyll to Github Pages
|
22
You can download the standard env.example file from the Laravel source code, rename it to .env and edit it. Just set up correct DB credentials, etc.
Don't forget to run the php artisan key:generate command which will generate an application (encryption) key and add it to the .env file.
Share
Improve this answer
Follow
edited Aug 6, 2018 at 19:14
Kenny Evitt
9,37166 gold badges6767 silver badges9595 bronze badges
answered Aug 20, 2016 at 11:37
Alexey MezeninAlexey Mezenin
161k2626 gold badges297297 silver badges283283 bronze badges
2
I get that you can copy it from the source code off Laravels repo but everytime im cloning a project I must do this? I found a command but it doesn't seem to work, at least for me: copy .env.example .env it outputs zsh: command not found: copy into the terminal
– Eduardo
Sep 9, 2021 at 19:28
@Eduardo copy command runs only in windows os. For zsh, use cp
– risingStark
Sep 14, 2021 at 17:02
Add a comment
|
|
I'm new to laravel and i recently pulled a project from git-hub and it wouldn't run because it's missing the .env file i tried composer install but that didn't work. Is there any other way to generate the .env file?
|
Laravel project missing .env file
|
Just create an empty repository and, from the fully updated clone, do:
git remote add new-origin url://to/new/origin
git push --tags new-origin refs/remotes/origin/*:refs/heads/*
Obviously, if the new origin is at the same url as the original one, you must be careful to not fetch from origin.
|
Say you have a scenario with a central master git repository, which developers and CI-engines clone from. I.e. very close to a traditional non-distributed version control system setup, with a central hub and a lot of nodes. This could be a cloud service like Github (Gitlab/Savannah/Azure etc), or a Synology with git server or another in-house setup.
Now say that server was stolen or struck by lightning or any other thing that would result that the central repository was gone along with all its centralized backups. All you have left is the various clones, and by good fortune one of these was fully updated, so you create a blank git repository replacement server to be used as the future central repository and go to work on the clone.
The fully updated clone knows of all the "remotes/origin" branches with "git branch -a", but does only have a single local branch. (This is what worries me - losing branch information).
What would the steps be for reestablishing a new central git repository behaving in any way like the old one, branches and all?
|
Firedrill: Recreate Github (or any other central) repository from developers clones
|
You cannot host executables on github.
You can now use releases.
|
I want to distribute executables along with my source. My source is all hosted tidily on GitHub. Is it possible to add executables and installers to my GitHub project page without adding them to my git repository?
Note, for some reason GitHub discontinued this feature. See Answer by Justin Dearing below.
|
Host executables on GitHub?
|
16
Yes you can.
And actually I think it's a more convenient way comparing to FTP.
Make sure your Git is set to "commit as-is", so that you can avoid some signature issues.
Publish your ClickOnce application to a directory in your git repository (you may want another branch for that) with the url of raw on Github as the download/update url. E.g. for repository "xxx", branch "master", directory "clickonce" of user "vilic", the url should be "https://raw.github.com/vilic/xxx/master/clickonce/"
Commit and push your application.
BTW, you will be able to download exe file and the application is able to check and download update as you are directly using raw.github.com. However, you may not open the xml file from your browser because the MIME type of xml file would be "text/plain". But I think you can try to use Github Pages to build this server, which should response with the right MIME type.
Share
Improve this answer
Follow
edited Nov 30, 2012 at 17:03
answered Nov 30, 2012 at 16:33
vilicvanevilicvane
11.8k33 gold badges2222 silver badges2727 bronze badges
3
1
Thanks to your answer, I tried this out and is working really well. Here is my post documenting how this is being done. - flickrdownloadr.com/blogs/blog/2013/01/15/…
– Hari Pachuveetil
Jan 15, 2013 at 7:10
So you can reference in your readme.md to the setup.exe like this https://rawgithub.com/vilic/xxx/master/clickonce/setup.exe?
– JP Hellemons
Jan 27, 2015 at 7:57
Thank you @vilicvane I probably did something wrong then stackoverflow.com/questions/28174391/…
– JP Hellemons
Jan 27, 2015 at 15:46
Add a comment
|
|
I'm wondering if you can create a ClickOnce installer for a project and then host the installation folder on GitHub (via the downloads page)?
I guess by default ClickOnce publishes the installation files to a subfolder which I think is not supported on the Github downloads page but maybe there is another way.
|
Is it possible to offer a ClickOnce installer on Github?
|
i'm pretty sure github issues are agnostic of branches.
are you talking about a local branch or a tracking branch? if your not specifically tracking the branch on github, the branch will not be pushed - thus github will not see your close #XXX command. here's some info on remote branches from the progit book http://git-scm.com/book/en/Git-Branching-Remote-Branches
UPDATE
i emailed this problem to the github support staff and they confirmed this is expected behavior. here's the response i got from them:
It is because of a recent change we made. Issues are only closed when the commits are merged to the default branch of your repository. I am sorry for the confusion.
|
I am not working on the Master branch. I am working on a different one newFeature , which is also published on github.
I know how to to close issues when working on the Master branch: Closes #XXX.
However this only works when I am working on the Master branch, if I switch over to the other branch or a different one and do a commit with Closes #XXX it does not close the issue.
My question is:
Is it possible to do this and how do you do it?
|
Closing a GitHub Issue while on a different branch
|
You'll need to explicitly specify the B gem in your Gemfile to use a git repository or another version. As long as A 1.0.0 is compatible with B 1.0.1 you'll be fine. If it is only compatible with B 1.0.0 then you'll have to create your own fork of the A gem and upgrade the gemspec to be compatible with B 1.0.1 and then use that repository as your gem for A instead of the rubygems version.
Here is a sample Gemfile that should give you what you want, provided A 1.0.0 is compatible with B 1.0.1.
gem 'B', :git => 'git://github.com/B/B.git', :tag => '1.0.1'
gem 'A', '~> 1.0.0'
|
If there are two gems, A and B. A1.0.0 depends on B1.0.0.
In my Gemfile:
gem 'A', '~> 1.0.0'
Then run bundle. It will generate a Gemfile.lock like:
A (1.0.0)
B (1.0.0)
But if I want to force A to use B1.0.1, what's the best practice? Moreover, if the B1.0.1 is not release but a github tag?
|
Can I force a gem's dependencies in gemfile?
|
You probably want to look at this GitHub help page. It says:
You can use any of the following keywords to close an issue via commit message:
close
closes
closed
fix
fixes
fixed
resolve
resolves
resolved
So "Fixes #123" or "Resolved #456" will work. All pull requests are mapped as issues, so this will works for pull requests too.
Note: you'll see a message about unmerged commits because you amended the pull request. So looking at the pull request, it won't be immediately obvious that the PR was incorporated (versus just plain closed) unless you put something meaningful in the first line of the commit message so you can see the message in the pull request.
|
My team uses pull requests internally for code-reviewing the application we maintain, but when it's time to merge a commit, we just push directly to master. We're all repo collabs anyway, and by not using the pull request to merge code, we avoid polluting our commit history with merge commits. Since the app is internal to our team, no one else is affected.
What I want to know is, can I amend my commit message with something like "closes PR #30" and have github automatically close the pull request for me?
I know you can use commit messages to close issues, so I'm hoping there is something similar for pull requests. I did a quick search online and of SO, and didn't see anything.
|
How to close a GitHub pull request with a commit message?
|
I know there are WebHooks, but is there a way to also hook into the UI?
The recommended way of doing this is to use required status checks and the Status API, in combination with webhooks:
https://help.github.com/articles/about-required-status-checks/
https://developer.github.com/v3/repos/statuses/
Users set up required status checks on the repository so that merging a pull request is blocked if a specific status isn't success.
At the same time, webhooks trigger an external process when a pull request is updated, and that process creates statuses based on the output of that process. If the process completes successfully, then the process should create a success status which will be shown in the UI and unblock the merging of the pull request.
Is it only via Web Hooks, API calls and getting write oAuth credentials?
In order to create statuses, you will indeed need to authenticate with the credentials of a user that has push access to the repository (e.g. via a token from that user with the right scopes).
|
Is it possible to create a Github Check for pull requests? I know there are WebHooks, but is there a way to also hook into the UI?
Aim:
Pull Request made. Perform validation and update pull request if valid.
Pull Request merged. Create web call to URL. Update Github issue with confirmation.
What's the best way to do this? Is it only via Web Hooks, API calls and getting write oAuth credentials?
|
Github Pull Request Checks
|
I tweeted the question: "is there a way to get the current branch name in a pull request template?"
mentioning the GitHub account and this is the answer I was given:
No, there currently isn't but if this is something you want included in all pull request submissions, you might want to check out Probot: https://probot.github.io . I recently created https://github.com/probot/view-rendered … that edits the pull request body to add rendered links for docs.
Link to tweet: https://twitter.com/korndaniel1/status/1022468460226469888
|
I'm creating a pull request template for my repository.
I added a new file, following the instructions at https://help.github.com/articles/creating-a-pull-request-template-for-your-repository/ , and now I want its' body to contain a string generated using the current branch name (the pull request branch name).
Couldn't find the answer in GitHub's docs, would like to know if it's possible and if so how?
|
GitHub pull request template: get current branch name
|
If you want to make the project your own, there are two ways to do it.
The right way:
Contact github support. This is the right way and the best way as they usually reply within hours. (Check out forks for information about forks)
The not so right way:
Create a new repository and add contents from the forked repository.
Step 1: git clone --bare https://github.com/Your/<Forked Repository>.git
Step 2: Goto your github account and delete the forked repository.
Step 3: Create a new repository with the same name
Step 4: cd <Forked Repository>/
Step 5: git push --mirror
|
I've forked a repo to create a new project. The new project is now indipendent and I want to change the base fork to the head fork when creating PRs by default, in order to avoid mistakes.
How can I do that on GitHub?
|
How can I change base fork on GitHub?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.