Response
stringlengths
8
2k
Instruction
stringlengths
18
2k
Prompt
stringlengths
14
160
8 AFAIK you would need to set that up yourself. Github has its own search syntax with qualifiers you can add, but not full regex. The api uses the same syntax as the in-browser search. Share Improve this answer Follow edited May 25, 2017 at 10:45 answered Jul 10, 2016 at 4:21 ldgldg 9,25233 gold badges3030 silver badges4545 bronze badges 2 "The api uses the same syntax as the in-browser search" Is that still true now that GitHub does offer regex search in-browser (by wrapping the regex like /regex/)? – MichaelChirico Jan 26 at 1:56 1 @MichaelChirico you are correct, the API and Browser-based search use different syntax rules. From the documentation "You only need to use the legacy code search syntax if you are using the code search API." So API searches use legacy search syntax which is more limited and does not allow regex. – Trevor Steen Feb 12 at 18:09 Add a comment  | 
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago. Improve this question I wanted to search my company's github source website using regular expressions. is that possible in anyway?
Searching a github repo using regular expressions [closed]
5 +500 Any chance you could accomplish what you're looking for with Job Summaries? https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/ https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary If you need something in the actual PR, it's possible to write your own Github Action that will comment/update based on the data you determine. Take a look at the Github Actions Toolkit, specifically @actions/github: https://github.com/actions/toolkit Share Improve this answer Follow answered Apr 23, 2023 at 4:24 TManTMan 1,84511 gold badge1717 silver badges2727 bronze badges Add a comment  | 
Is there any possible way to show pretty HTML reports (from test runners like Jest, Mocha, Cypress, test coverage, etc.) on GitHub's pull requests checks?
HTML reports on GitHub Actions / GitHub pull requests
Annotated tags are created using the -a flag. The difference between regular tag to annotated tag is that the annotated tag is like a commit, it contain the date, author and the message attached to it. Once you create the tags simply push it to the github repository git push --tags. Since tags are simply a pointer to a given commit you can "move" them between commit. Creating annotated tag git tag -a <tagname> Moving an existing tag git tag -a <tagname> <SHA-1> -f Pushing the tags git push origin --tags -f The important thing is the -f (force) flag
I've created a release on github, but it seems to be a non-annotated tag. Anyone know how to make an annotated tag along with a release? Is it OK to just replace the tag with an annotated one -- will it still work?
How to create a github release with an annotated tag?
2 Update GetHub enterprise now has the ability to create custom roles in which you can assign the permission to bypass branch policy. The only way to excempt users is to make them repo admins and allow admins to bypass the policy. Or use a GitHub actions workflow that uses the PAT if an admin to push to the target branch if the changes were pushed by allow-listed users. That opens up some interesting security issues though. Share Improve this answer Follow edited Nov 16, 2022 at 18:06 answered Feb 10, 2022 at 21:25 jessehouwingjessehouwing 110k2222 gold badges264264 silver badges358358 bronze badges Add a comment  | 
I am trying to use lerna publish to manage package publishing in my team. So what lerna does at the end of every publish is, it bumps the version in the package.json file and commits those changes in the branch that did the publish. However in master I need "Require pull request reviews before merging" to be active as it is protected branch. My problem is not in publishing as lerna publishes the package. However the circle-ci fails with this error: remote: error: GH006: Protected branch update failed for refs/heads/publish-test. remote: error: At least 1 approving review is required by reviewers with write access. To github.com:username/repo.git ! [remote rejected] publish-test -> publish-test (protected branch hook declined) I tried enabling "Restrict who can push to matching branches" option to allow a user to commit in master, (we are using a bot user for devops commits). Is there a way to add a user exception to the option "Require pull request reviews before merging" or do a pre-merge hook(so I can publish before the merge in ci)?
How to add a user exception to "Require pull request reviews before merging" option in git protected branch?
If your directory structure looks like this: /------WebsiteName/ | |-----------/Mobile/ Then make sure you are in WebsiteName directory, then run git status If you are still getting the same error then run the following in order: git init git status //here you should see the mobile folder and its files git add --all git commit -am "committing" git push --all
I am working with the Github windows client connected to my remote bitbuckket git. I recently started building a mobile version of my application in /mobile I have been working in localhost/WEBSITENAME but am now in loaclhost/WEBSITENAME/mobile with the git repository folder set to the WEBSITENAME folder. After creating the new folder Github is not detecting the new folder preventing me from pushing my new files.
Github doesn't detect new folder
It's possible, but the documentation is perhaps not in the place you'd expect it to be. http://developer.github.com/v3/git/refs/ You can also request a sub-namespace. For example, to get all the tag references, you can call: GET /repos/:owner/:repo/git/refs/tags
I would like to know how to use the github-api to get all the current releases or tags for a project. I have seen the documentation for tags in github-api but I don't see a way to list all tags or list all releases but only list a specific tag by :sha.
How can I use github api to get all tags or releases for a project?
For those interested, I managed to solve my issue although not quite sure how or more precisely which of the steps that I used, did help me solve the issue. So basically, I first revoked my tokens and made a new one. Then I logged in to docker like this docker login -u USERNAME -p TOKEN ghcr.io while before I would use docker.pkg.github.com and then managed to push my docker image manually to GitHub Package Registry which then made the GitHub Action flow works as well, although I did change nothing there. I hope that helps people who have the same issue.
I am currently trying to run a docker GitHub Action which builds and pushes a docker image to the GitHub Packages but I am receiving an error which I have never seen. For some reason it fails to push the docker image because write_permission is denied but I have a token allowing me to write so I don't understand what the problem is. This is my action file: name: Docker Image CI on: workflow_dispatch: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up JDK 16 uses: actions/setup-java@v1 with: java-version: 16 - name: Build with Maven run: mvn -f ACS/pom.xml clean install dependency:copy-dependencies - name: Login to GitHub Package Registry run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{ github.repository }} --password-stdin - name: Build the Docker image run: docker build -t image:latest . - name: Tag the Docker image run: docker tag image:latest docker.pkg.github.com/organization/repository/image:latest - name: Push the Docker image to the registry run: docker push docker.pkg.github.com/organization/repository/image:latest This is my error: Run docker push docker.pkg.github.com/organization/repository/image:latest The push refers to repository [docker.pkg.github.com/organization/repository/image] f0eaf014e806: Preparing 7d0bad636b3f: Preparing aa0870e7c621: Preparing 36d2f9f005e6: Preparing 22bb3686ee25: Preparing 05e198868a20: Preparing b5cea4a3dd43: Preparing 93c7a8a0e1f4: Preparing 7f4b55b885b0: Preparing 05e198868a20: Waiting b5cea4a3dd43: Waiting 93c7a8a0e1f4: Waiting 7f4b55b885b0: Waiting denied: permission_denied: write_package
GitHub: denied: permission_denied: write_package
You don't have a branch called main. You have a branch called master. Either push with the correct name: git push -u origin master Or change your local branch name to main and use that: git branch -m main git push -u origin main
I was trying to use git via VSCode, and because I didn't know how to use Git on VSCode, it messed up everything. Then I tried to use CMD (Windows) as usual. I am learning, and I've never seen this kind of error before, so I don't know how to solve this. But it's showing these errors when I try to push to the main branch: error: src refspec main does not match any error: failed to push some refs to 'myPathToRepo' I tried: I tried with another branch and it was working fine but I want to use the main branch I even tried deleting the git folder and initiating it again I've seen other posts on StackOverflow and mostly they say "first commit and then push because this error arises when you're pushing without committing". After deleting the .git/ folder and restarting, it starts to show this same error >git push fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master >git push -u origin main error: src refspec main does not match any error: failed to push some refs to 'myPathToRepo' This is my first commit: [master (root-commit) 061a06e] first commit PS. I only have 'main' branch. Commands that I ran: git init git remote add origin 'pathToMyRepo' git add -A git commit -m "first commit" git push git push -u origin main Please help.
git: error: src refspec main does not match any
35 If it is a corporate repo, you might want to ignore proxy settings. One possible solution to your problem is here: Ignore proxy: export no_proxy=YOUR_CORP_DOMAIN_ON_GITHUB, where the domain name might be in the form of github.acme.net Ignore SSL verification: git config --global http.sslVerify "false" You could then clone the repo w/ git clone YOUR_HTTPS_CLONE_URL Share Improve this answer Follow answered Mar 10, 2017 at 2:31 srctahasrctaha 1,40411 gold badge1515 silver badges1616 bronze badges 2 7 On Windows, the command is: set no_proxy=YOUR_CORP_DOMAIN_ON_GITHUB – Brandon S May 10, 2018 at 13:44 Excellent answer, still helps :) – Arka Mukherjee Jan 3, 2022 at 16:24 Add a comment  | 
I am trying to clone from a corporate git repo, but always receive this error message after a while: fatal: unable to access URL: Received HTTP code 503 from proxy after CONNECT I have the following .gitconfig file: [https] sslVerify = false proxy = https://proxy.corpadderess:8080 [http] sslVerify = false proxy = http://proxy.corpadderess:8080
Corporate Github behind proxy: Received HTTP code 503 from proxy after CONNECT
43 I found the answer! I just had to change the gradlew file permission on the git repository to make it executable using this command: git update-index --chmod=+x gradlew git commit -m "Make gradlew executable" it was simple but killed my time! Share Improve this answer Follow answered Oct 8, 2019 at 8:39 Mohsen MirhoseiniMohsen Mirhoseini 8,70466 gold badges3636 silver badges5959 bronze badges Add a comment  | 
I have a very simple gradle project and when I setup GitHub Actions CI I face this error: Run ./gradlew clean dependencies ./gradlew clean dependencies shell: /bin/bash -e {0} env: JAVA_HOME: /opt/hostedtoolcache/Java/8.0.222/x64 JAVA_HOME_8.0.222_x64: /opt/hostedtoolcache/Java/8.0.222/x64 /home/runner/work/_temp/8f29e484-fbb4-4e29-a02a-679519aec24c.sh: line 1: ./gradlew: Permission denied ##[error]Process completed with exit code 126.
Why when I use github actions CI for a gradle project I face "./gradlew: Permission denied" error?
43 Use encoding='cp1252' will solve the issue. Share Improve this answer Follow edited Oct 27, 2018 at 0:56 answered May 5, 2018 at 4:01 Abdul RehmanAbdul Rehman 5,4461111 gold badges8181 silver badges158158 bronze badges 1 This solved it for me! As simple as reading in the file with this encoding. – Will J Jul 16, 2019 at 4:16 Add a comment  | 
I am getting the following error while executing the below code snippet exactly at the line if uID in repo.git.log():, the problem is in repo.git.log(), I have looked at all the similar questions on Stack Overflow which suggests to use decode("utf-8"). how do I convert repo.git.log() into decode("utf-8")? UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 377826: invalid start byte Relavant code: .................. uID = gerritInfo['id'].decode("utf-8") if uID in repo.git.log(): inwslist.append(gerritpatch) ..................... Traceback (most recent call last): File "/prj/host_script/script.py", line 1417, in <module> result=main() File "/prj/host_script/script.py", line 1028, in main if uID in repo.git.log(): File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 431, in <lambda> return lambda *args, **kwargs: self._call_process(name, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 802, in _call_process return self.execute(make_call(), **_kwargs) File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 610, in execute stdout_value = stdout_value.decode(defenc) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 377826: invalid start byte
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 377826: invalid start byte
66 You are probably using an organization, which means you must first enable this behavior on the organization level and then on the repository level Go to https://github.com/organizations/YOUR_ORG/settings/actions and check Allow GitHub Actions to create and approve pull requests Then go to https://github.com/YOUR_ORG/YOUR_REPO/settings/actions and check the box that previously was grayed out Share Improve this answer Follow edited Aug 5, 2022 at 13:25 answered Jul 28, 2022 at 15:15 aviggianoaviggiano 1,5032020 silver badges2323 bronze badges 3 3 Great, thank you! Seems step 2 wasn't required in my case, because it was already checked by the first step I guess. – Rutger Aug 4, 2022 at 11:27 7 0. If you are using GitHub Enterprise, you need to check the box there also github.com/enterprises/YOUR_ENTERPRISE/settings/actions Additionally it seems to enable it in the organization and repositories by default after enabling it in the enterprise. – dataviruset Oct 18, 2022 at 12:17 1 A million thanks @aviggiano – Spiff Jekey-Green Jul 20, 2023 at 20:05 Add a comment  | 
Since the 3rd of May this month, github added the setting Allow GitHub Actions to create and approve pull requests for creating pull requests in github actions, under Settings > Actions > General. However, it seems I cannot select this option for my repo, it is grayed out without any explanation why it is grayed out. Whenever the "default permissions" setting is changed and saved, it is possible to select the Allow GitHub Actions to create and approve pull requests, but if it is saved it snaps back to the original grayed out version, unchecked. I also tried giving the workflow file the pull-request permission like so: permissions: pull-requests: write but that didn't work either. Is there something I am missing which prevents me from using pull requests within github actions?
GitHub Actions is not permitted to create or approve pull requests (createPullRequest)
There are two ways to solve this problem: Specify publishConfig option in package.json: "publishConfig": { "registry":"https://npm.pkg.github.com/@OWNER" }, Add .npmrc file to your project with this content: registry=https://npm.pkg.github.com/@OWNER replacing OWNER with the name of the user or organization account on GitHub that owns the repository where you will publish the package.
I'm trying to upload a package on GPR (Github Package registry). I log in successfully: npm login --registry=https://npm.pkg.github.com and then run these command: npm set registry https://npm.pkg.github.com/ npm publish which returns this error: npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/package-name npm ERR! 404 npm ERR! 404 'package-name@version' is not in the npm registry. Seems it tries to upload a package on npm registry instead of github package registry. How should I fix this problem?
Not Found - PUT https://npm.pkg.github.com/package-name
24 I had a similar issue recently, I'm not sure whether its exactly the same as I got the connected user by following command. ssh -T [email protected] But when I try to push the code to remote repository I got same error. kex_exchange_identification: read: Connection reset by peer fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. After trying few solutions from the internet without success, I just tried git init and it worked for me. I hope this works only if the connection user has bound correctly. Try it out Good Luck.. :) Share Improve this answer Follow edited Sep 28, 2021 at 11:30 answered May 3, 2020 at 17:11 KandyKandy 1,0871212 silver badges2929 bronze badges 0 Add a comment  | 
I'm very new to github, I started using it about two weeks ago. Everything worked perfectly, I was able to push and pull from my remote repository. Today, however, when I tried to pull from it I got this error message: ssh_exchange_identification: read: Connection reset by peer fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. When I try to do anything that connects to my remote github repository (push, pull, fetch, etc), in fact, it gives me back the same error. When I type in this command: "ssh -T [email protected]", I just get: ssh_exchange_identification: read: Connection reset by peer I didn't modify any settings in my repository or in my SSH keys or anything so I have no idea why it stopped working all of a sudden. What could be the problem?
"ssh_exchange_identification: read: Connection reset by peer" error when trying to connect to remote repository on git
40 All analytics for a GitHub repository is available at https://github.com/<username>/<reponame>/graphs/traffic Share Improve this answer Follow answered May 23, 2014 at 20:53 NARKOZNARKOZ 27.5k77 gold badges6868 silver badges9191 bronze badges Add a comment  | 
Just wondering if there is any Analytics type things available for github. I'd be curious to know who is viewing / using my code, if anyone...
Is it possible to track views and clones of my github repositories
This Github document reads: The https:// clone URLs are available on all repositories, public and private. But since you are trying to access a private repository, authentication is required. One way is appending username and password the address as below: git clone https://username:[email protected]/usernamex/privat-repo.git But the same page reads: If you have enabled two-factor authentication, or if you are accessing an organization that uses SAML single sign-on (SSO), you must authenticate with a personal access token instead of your username and password for GitHub. If you have 2FA enabled, check this page for steps to generate a personal access token. Bear in mind that you should check full repo scope (as shown below) for your personal token.
I forked a private repository that I was invited to collaborate on but every time I try to clone with HTTPS, I get the following error message: $ git clone https://github.com/usernamex/privat-repo.git cloning into 'privat-repo'... Username for 'https://github.com':usernamex Password for 'https://[email protected]': remote: Repository not found. fatal: repository 'https://github.com/usernamex/privat-repo.git/' not found Note: 'usernamex' and 'privat-repo' are just examples Here's some things I have tried with no success: Verified the validity of the URL - Checked spelling and case. I am able to access the repo URL and download its contents through my browser by clicking the download ZIP button. Asked owner to clone my fork - He had no problems cloning my fork but I do. Contacted GitHub support... Per GitHub support, cleared cached credentials - this is confirmed by the fact that the system requires my username and password with git clone and git push. In fact, I can clone and push other (public) repositories in my account. Went through GitHub's HTTPS Cloning Errors guide with the exception of "Using SSH instead" because this doesn't really address the issue. Viewed similar questions in stackoverflow.com - tried most suggested answers (see above). I am running git 2.10 on a mac through Terminal and, as I mentioned, I am not interested in workarounds to HTTPS (e.g.: SSH or GitHub Desktop). Any ideas why this is happening?
git clone with https error - fatal: repository not found
First add the upstream remote git remote add upstream https://repoA git fetch upstream Merge in upstream changes git checkout master git merge upstream/master Resolve conflicts and push git push origin master Your pull request should automatically update
I have forked my repo, we'll call it repoB from another repo we'll call repoA. Now I don't have permissions to write into repoA. When I try to create a pull request on repoA to get the latest changes and merge those in to repoB I get a merge conflict error. How do I solve that? I tried this: git checkout -b repoA master git pull https:repoA master git checkout master git merge --no-ff repoA git push origin master N.B. I cannot checkout forkA as I don't have write permissions on that.
How to solve merge conflicts across forks?
36 Create a file called .gitignore in your repository. Add the text "App_Data" to this file. Save. It should do exactly what you want. It will exclude files/folders with that string from your local repository path (the path where .gitignore is stored). Keep in mind, this is not your only option. I'd read the help document linked below for a better understanding to get exactly what you need accomplished. See here for more info: GitHub Help - Ignoring Files Share Improve this answer Follow answered May 22, 2013 at 13:16 MrHappyAsthmaMrHappyAsthma 6,4321010 gold badges4949 silver badges8080 bronze badges 2 is the / at the end what makes it know its a directory it should ignore? So if I want to ignore folders that start with data should I do data/ or data? – Charlie Parker Jan 18, 2017 at 22:00 The slash is a bit different that ignoring the slash. See: git-scm.com/docs/gitignore#_pattern_format – MrHappyAsthma Jan 18, 2017 at 22:41 Add a comment  | 
I need to exclude the folder App_Data from my Github but i don't know how. I have a application which saves many files like jpg files in the directory: Source\MyProject\App_data\stored\filename.jpg Now i need to exclude this from the .gitignore file I don't know how to do this so i am looking for a example
Exclude folder from github
22 Version 3 of the GitHub API allows this in a pretty simple way: https://api.github.com/users/koraktor/gists gives you a list of all Gists of the user and that list offers a various amount of URLs including the API URLs to the individual Gists like https://api.github.com/gists/921286 See the Gists API v3 documentation. Share Improve this answer Follow answered Jul 17, 2011 at 14:48 KoraktorKoraktor 41.9k1010 gold badges6969 silver badges9999 bronze badges 3 Forgot to comment a while back. This looks promising. When I have a system to work with this, I will get back to you. Thanks. – songei2f Aug 4, 2011 at 9:56 1 I tested this and it doesn't list all gists for the user – Sam Jul 1, 2014 at 9:22 4 Please note that the link above will only get all the gist on the first page. If you need to access all your gist, then put "?page=<number>" at the end of URL, by default it opens first "1" page. – Mohd Shahril Jul 12, 2017 at 11:46 Add a comment  | 
Is there an API call or any scripts that I failed to overturn that would pull all my Gists from Github to an outside git repo or just return me a list of their names? I know each one is a separate git repo, so I have assumed the best I can do is get the latter, then script to get all of them onto my local box. EDIT 1: I know about pulling and pushing git repos from one service to another, I am specifically looking for people who have the 411 on collecting an authoritative list of all Gists I have, private and public. I also thought this might be useful to others. It is not so much about migration, but a backup strategy . . . of sorts. EDIT 2: So, it appears this might not be possible. I apparently did not Google hard enough to search the updated Github/Gist API. The other API calls work with simple curl commands, but not the v1 API for Gist. Still, the API says TBD for all private and public Gists, so I think that puts the cabash on the whole thing unless an enlightened soul hooks a brotha up. $ curl http://github.com/api/v2/json/repos/show/alharaka {"repositories":[{"url":"https://github.com/alharaka/babushka","has_wiki":true,"homepage":"http: ... # tons of more output echo $? 0 $ This one does not work so hot. $ curl https://gist.github.com/api/v1/:format/gists/:alharaka $ echo $? 0 $ EDIT 3: Before I get asked, I noticed there is a difference in the API versioning; this "brilliant hack" did not help either. Still very cool though. $ curl https://gist.github.com/api/v2/:format/gists/:alharaka # Notice v2 instead of v1 $ echo $? 0 $
Pull All Gists from Github?
30 In my case, there was already a .git directory from another imported third-party git repository. I had to removed it, anything worked well. Share Improve this answer Follow answered Jun 22, 2014 at 21:21 Max PowerMax Power 39922 silver badges55 bronze badges Add a comment  | 
I am trying to commit changes I have made to my code (as usual) from my GitHub client on my Mac OS X Mavericks machine. I added a new package to my project (it's a Laravel project, and I added the package Rocketeer. I also made a few config changes). I am getting the error: Failed to add file laravel-master/vendor/anahki When I uncheck this file in the commit list, it then goes to another file showing this error. Failed to add file laravel-master/vendor/illumin Any idea what is going on? I have never run into these issues. Thank you. EDIT: I have narrowed this down to two files that are not being allowed to commit (this is for a Laravel project): These are the errors I get when I try to commit these two folders/files: Failed to add file laravel-master/vendor/illuminate/remote/Illuminate/Remote/ to index. Failed to add file laravel-master/vendor/anahkiasen/rocketeer/ to index.
GitHub Client on OS X Commit Fail ("Failed to add file ...)
From @nschum For future reference: git now supports pushing from shallow clones (since version 1.9). It will still fail when pushing to an outdated fork that's older than your history. (Aside: Unfortunately copy/paste is the recommended way to promote a comment to an answer)
I had a massive git repo because of a huge number of commits, so following advice here I created a shallow clone. I've made changes to this new local repo, and now I want to push to my origin at Github (and then on to my staging and production remotes on Heroku). Perhaps one day I'll learn to read the documentation: The git clone --depth command option says --depth Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it) So... how can I unpick myself from this situation and push my code to Github?
Pushing to github after a shallow clone
The ssh way to do this would be using ~/.ssh/config, creating a hostname alias and accessing github with different hostnames for both projects. I have no idea whether there is a git config (or git remote) way too. Host a.github.com HostName github.com User git IdentityFile ~/.ssh/project-a-id_rsa Host b.github.com HostName github.com User git IdentityFile ~/.ssh/project-b-id_rsa Then use a.github.com:user/project-a.git or b.github.com:user/project-b.git (or similar) as your repository URLs.
Probably a simple question, but I am at a loss here... In github one can add a deployment key for each repository which only gives access to that single repository. But for one client I have two projects managed with git on the same server (project A and project B). If I use the public key for project A, github tells me I cant use it as a deployment key for project B and vice versa. How can I create another public key and setup git to use one key for project A and the other one for project B?
git setup for multiple repos on same server
The main source of information about dotfiles is dotfiles.github.io. It references blog posts like Using Git and Github to Manage Your Dotfiles, based on a symlink method. For starters, we’ll be putting all of our dotfiles into a folder called dotfiles, like so: /home/smalleycreative/dotfiles/vimrc. Then, we’ll simply symlink to them from our home directory. Jaime mentions the Atlassian tutorial "The best way to store your dotfiles: A bare Git repository" The technique consists in storing a Git bare repository in a "side" folder (like $HOME/.cfg or $HOME/.myconfig) using a specially crafted alias so that commands are run against that repository and not the usual .git/ local folder, which would interfere with any other Git repositories around. (and then the dotfiles folder is managed as a git repo)
I stored my dotfiles in github, with lots pains, because of no automation. I have to update it myself. Is there a way that can auto install/update/sync dotfiles? I mean in a fresh server, I download dotfiles and exec a install script to copy dotfiles to local. After some time, I can exec a updateToRemote script to push local changes to remote repo, and on another server, I can exec a updateToLocal script to pull remote changes to local. Something like that.
How to use Github to manage dotfiles?
I just solved the same problem, so allow me to share my finding. From Xcode, select the project root in the Project Navigator. Right click, and select Add Files to <Your Project>... Choose README.md; make sure to uncheck the copy-file option and any group, like this: Click Add. Done.
I'm trying to add a README.md file in my Xcode Project, and push it to GitHub. How can I do it? Creating a file inside the root of the project doesn't work because - I think - Xcode doesn't see it.
How can I add a README.md file with Xcode?
ERROR: type should be string, got "\nhttps://github.com/github/linguist/compare/master...gjtorikian:master\n\ngithub:master is up to date with all commits from gjtorikian:master.\n Try switching the base for your comparison. \n\nIt means that all commits from gjtorikian/liguist are part of github/linguist.\nThe reverse is not true:\nhttps://github.com/gjtorikian/linguist/compare/master...github:master\nThat would give all (1866) commits from github/linguist which are not part of gjtorikian/linkguist.\nThis is triple-dot '...' diff between the common ancestor of two branches and the second branch (see \"What are the differences between double-dot “..” and triple-dot “…” in Git diff commit ranges?\"):\n\nIn the first case github/linguist:master...gjtorikian/linguist:master, the common ancestor and gjtorikian/linguist:master are the same! O commits.\nIn the second case gjtorikian:master0, gjtorikian:master1 has 1866 commits since the common ancestor (here, since gjtorikian:master2).\n"
Short version When I compare two forks on Github, it does not compare the latest states, but the current state of the base fork with the last common commit (or am I wrong?); so how can I compare the latest states/heads on Github? Longer version I am trying to compare two repositories on Github. It does not seem to compare the latest states of both repository. Instead, it compares: the base fork as it was when both repositories where identical (last common commit?) with the head fork as it is now. You can see this in the Github's fork comparison example, it says there are no changes between those two repositories, but there are now very different. How can I compare the latest states/heads on Github?
Github: comparing across forks?
This fork isn't published in the maven central repo. Then you can't use an import like compile com.theDazzler:androidbootstrap:+ You have to: - clone this library locally as a module in your project Clone the https://github.com/theDazzler/Android-Bootstrap/tree/master/AndroidBootstrap folder in your root/module1 folder. root: module1 build.gradle app build.gradle settings.gradle Change your settings.gradle file in include ':module1' include ':app' In your app/build.gradle file you have to add: dependencies { // Module Library compile project(':module1') } Finally in your module1/build.gradle you have to check the level used for gradle plugin. EDIT 31/10/2015: You can use another way to add a dependency with a github project,using the github repo and the jitpack plugin In this case you have to add this repo tp your build.gradle repositories { // ... maven { url "https://jitpack.io" } } and the dependency: dependencies { compile 'com.github.User:Repo:Tag' }
I want to compile the following library in my project in build.gradle: https://github.com/theDazzler/Android-Bootstrap It is forked from https://github.com/Bearded-Hen/Android-Bootstrap, but no documentation in the repository explains how to include in in project. I tried something like this: compile 'com.theDazzler:androidbootstrap:+' but gradle failed and shows error that library not found. Edit: Can anyone fork it and/or publish it?
How to compile forked library in Gradle?
It looks like you do not have the upstream remote / branch configured for this branch. Visual Studio operates as if the "push.default" configuration is set to "upstream". If you go to the branches page, this branch should be listed under the "Unpublished" branches section. From that page, you can choose to "publish" this branch by right clicking on the unpublished branch and selecting publish in the resulting context menu. This will push the branch to the origin remote (with a branch of the same name as your local branch) and set the upstream tracking information for this branch. From then on, you can push and fetch from the Unsynced Commits page. Here is a screen capture of where you need to go to publish an unpublished branch:
I have a GitHub source control tool added to my copy of Visual Studio 2013 and when I right click on the solution and make a commit it says created the commit locally. When I try to sync the commit with the server, the sync button is greyed out. My question is how do I set it up or what steps do I take so that the commit is pushed to the server?
How to push unsynced commits to GitHub?
This answer is just a refined version of my comments. Essentially you can install packages using devtools by unzipping a local zipfile downloaded from github, and then running the install function install("path/to/unzipped_pkg_zip_file") The latest dev version of devtools contains an install_local utility function that makes it easy to work directly with local zip files.
I probably have some issues in my connectivity (some sort of blocks, I don't know) and I can't install directly form gitHub > install_github("assertthat") Installing github repo(s) assertthat/master from hadley Installing assertthat.zip from https://github.com/hadley/assertthat/archive/master.zip I tried with lots of other packages, same result. However, I am able to download master.zip form the browser. Can you tell if it's possible install directly the .zip? thanks.
Install R packages from github downloading master.zip
Ah ... silly me. AWS OpsWorks is asking for the key that will be deployed to the app server, so it needs the private key (including -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- delimiters). The github deploy key, obviously, is the public key.
Added an RSA deploy key to my private github repo, but when I add it to my OpsWorks rails app (paste public key into the "Repository SSH Key" field), and try to save, I get the error message "Please provide a valid SSH key". Key was generated using ssh-keygen defaults (RSA 2048, no passphrase). Not sure what else could be amiss.
What are the requirements for AWS OpsWorks SSH keys?
As per GitHub help, the error you're getting is related to wrong SSH configuration. Please follow indications for setting up SSH for GitHub and check accordingly.
I am new to Git and GitHub. I created a new repository and tried to clone on my local machine. It worked for https and git-readonly URLs. That is, the following worked fine: git clone https://github.com/npsabari/testrepo.git git clone git://github.com/npsabari/testrepo.git But when I tried git clone [email protected]:npsabari/testrepo.git, it didn't work. It gave the following error message: Cloning into 'testRepo'... Permission denied (publickey). fatal: The remote end hung up unexpectedly And then I tried ssh [email protected], but I got the error: "Permission denied (publickey)." instead of the welcome message. What should I do to fix this? What is the reason for the error?
ssh clone not working with github
Just pass the foreign option to automake. This tells it that your software does not conform to the typical gnu standards, and thus omitting README is not an error. Typically, this is done in configure.ac: AM_INIT_AUTOMAKE([foreign]) but it can also be done by assigning AUTOMAKE_OPTIONS in Makefile.am: AUTOMAKE_OPTIONS = foreign
I'm using autotools for a libraries hosted on GitHub. Instead of using an ordinary README text file, I want to use README.md. When running automake, I get the following error Makefile.am: required file `./README' not found Is it possible to tell autotools not to check for README?
Use autotools with README.md
It seems that users credentials are being cached. Go to your project, open .git/config and remove the lines: [credential] helper = store # or helper=cache Check git-credential-store for more information. Edit: OP mentions in the comments that this is happening in Windows, for which, the other answer is more relevant for removing the credentials from the Control Panel.
Where I work many people use the same computer on the same account. We now use the shell instead of the GUI just for convenience. The first time someone committed it asked for their username and password, but after that just used their account for all commits. I'm sorry that I don't know much about the shell, but this is the first time I'm using it. The commands I use to commit and synchronize are: git commit -a git push origin [branch name here]
How do I make Git ask for a username and password every time I push?
You'll need to update your branch with new commits from master, resolve those conflicts and push the updated/resolved branch to GitHub. git checkout master git pull git checkout <branch> git merge master [ ... resolve any conflicts ... ] git add [files that were conflicted] git commit git push
I merged a PR with the GitHub web interface, which resolved in a successful merge commit. Afterwards, GitHub is complaining This branch has conflicts that must be resolved. Does anybody know why or how to get the status merged?
"This branch has conflicts that must be resolved" but it's already merged
26 Try this: git push -u github master This will set your local master branch to track the master branch on the github remote. Next time you push this branch, you should be able to use the shorter command git push. Share Improve this answer Follow answered Jan 12, 2014 at 10:51 johndbrittonjohndbritton 2,66211 gold badge1919 silver badges2020 bronze badges 1 5 to fix all branches at once: git push -u github --all – keremispirli Dec 27, 2015 at 18:03 Add a comment  | 
Please see following screen details - git remote -v command is showing that I have test_vishwas added but when I am giving Push command it is giving error. Anybody can help ? C:\Users\vishwas_gupta03\Documents\GitHub\test_Vishwas [master]> git remote -v github https://github.com/vishwasjione/test_Vishwas.git (fetch) github https://github.com/vishwasjione/test_Vishwas.git (push) origin C:\Users\vishwas_gupta03\Documents\GitHub\test_Vishwas [master]> git push fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository us ing git remote add <name> <url> and then push using the remote name git push <name> C:\Users\vishwas_gupta03\Documents\GitHub\test_Vishwas [master]>
fatal: No configured push destination
Should these be added to .gitignore before pushing my site to github? They should not be in the repo at all, meaning stored outside of the repo. That way: you don't need to manage a .gitignore, you can store those keys somewhere safe. GitHub actually had to change it search feature back in 2013 after seeing users storing keys and passwords in public repositories. See the full story. The article includes this quote: The mistakes may reflect the overall education problem among software developers. When you have expedited programs—"6 weeks and you'll be a real software developer"—to teach developing, security becomes an afterthought. And considering "90 percent of development is copying stuff you don't understand, I'd bet most of them simply don't know what id_rsa is" In 2016, this "book" (as a joke) reflects that: The OP adds: I think Heroku requires putting the files into the repo in order to run ">heroku certs:add server.crt server.key" and setup the cert. "Configuration and Config Vars" is one illustration on that topic: A better solution is to use environment variables, and keep the keys out of the code. On a traditional host or working locally you can set environment vars in your bashrc file. On Heroku, you use config vars. The article "Heroku: SSL Endpoint" does not force you to have those key and certificate in your code. They can be generated directly on Heroku and saved anywhere else for safekeeping. Just not in a git repo.
In the process of setting up an SSL certificate for my site, several different files were created, server.csr server.key server.pass.key site_name.crt Should these be added to .gitignore before pushing my site to github? Apologies in advance if this is a dumb question.
Should files involved in SSL certificate be kept confidential (added to .gitignore)?
As mentioned in "If I fork someone else's private Github repo into my account, is it going to appear in my account as a public repo?", you can fork a private repo (for which you were added as a private user). The resulting repo will still be private, and you will be able to make pull-requests.
I have been added to an organization that has some private repositories and I need to send them a pull request with some changes but I don't know if I can. I haven't a paid account on GitHub, so how can I fork that private repo to modify and send pull requests?
Github - Fork a private repo
You could leverage the Google Analytics for Mobile strategy. The draw backs are that : You would only be able to manually publish static image urls in for each wiki page. You would need to host the Google Analytics for Mobile server-side file on another server. Somewhat negating the whole exercise.
I have a couple of Github projects that I want to be able to track the traffic to. I have done this in the past by adding Google Analytics tracking code to each wiki page. However, the Github wiki upgrade in September broke this and I don't seem to be able to add Javascript code to my wiki pages anymore. A couple of random other points: 1) I'm aware that Github probably blocked JS on the wiki for security reasons. 2) I know Github provides its own very basic traffic graph but I would like all the power of GA. Is there any way for me to restore Google Analytics tracking to my Github wiki? If not, is there an alternative?
Add Google Analytics to Github wiki pages
28 There is a workaround. Steps as follows: Create new Github user eg. my-org-bot Generate Personal Access Token for this user on https://github.com/settings/tokens and save it somewhere (select repo scope for the token) Go to your repo and add my-org-bot to contributors Open your branch protection rules and add my-org-bot to the rule below: Go to repository secrets and add new secret for Actions with key =BOT_ACCESS_TOKEN and the value = Personal Access Token generated previously Modify your GH Workflow Checkout step with below: Now your workflow should be able to push directly to your protected branch on behalf of my-org-bot user. Share Improve this answer Follow answered Jun 6, 2022 at 9:40 QwalQwal 60977 silver badges1414 bronze badges 3 I can't seem to locate the "Allow specified actors to bypass required pull requests"-setting. Is this only available in the Enterprise edition perhaps? – Tristan Diependael Jul 10, 2022 at 19:16 I don't use enterprise and do have this option. Under Protect matching branches, select Require a pull request before merging. A bunch more checkboxes appear. The last one is Allow specified actors to bypass required pull requests. – Toomy Jul 24, 2022 at 16:00 I don't have it either, on enterprise or personal org. I can only bypass branch protection rules by team, not app, using the bypass list in the ruleset. By app would be nice. – b0bu Jun 29, 2023 at 21:59 Add a comment  | 
This is my github action workflow. name: Release on: push: branches: - main jobs: release: name: Release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: persist-credentials: false - name: Setup java uses: actions/setup-java@v1 with: java-version: 11 - name: Setup node uses: actions/setup-node@v1 with: node-version: "14.x" cache: npm - name: Install dependencies run: npm ci - name: Build package run: npm run build --if-present - name: Semantic release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} HUSKY: 0 run: chmod +x script/prepare-release.sh && npx semantic-release However, my workflow fails with the following error log. [semantic-release] › ✖ An error occurred while running semantic-release: Error: Command failed with exit code 1: git push --tags https://x-access-token:[secure]@github.com/didrlgus/convention-template.git HEAD:main remote: error: GH006: Protected branch update failed for refs/heads/main. remote: error: At least 1 approving review is required by reviewers with write access. Maybe it's because my main branch is a protected branch. How can I push with a protected branch on github action?
How to push to protected main branches in a GitHub Action?
The error which you see is artificial check of github, which I personally find unneeded. You can revert the revert locally then: git fetch origin master git checkout origin/master (or reset) git revert <REVERT HASH> git push origin master This should succeed, modulo conflicts with changes done since the revert. PS: actually, the error could be because of the conflicts.
I had a feature branch created, let's say feature/branch1 on github. I created a pull request for it and got it merged. When it reached our pipeline, we figured there was a problem and we got it reverted using the Revert button on Git This created a "Revert" PR that we merged with the master and all was well. After a few weeks, post other PRs that got merged into the master, we figured we would revert-the-revert. This time, we went into the Revert PR that was closed and tried to use the Revert button again. But we got this error message Sorry, this pull request couldn't be reverted automatically. It may have already been reverted, or the content may have changed since it was merged. How do I get this revert done? The most ideal situation I would like to have, is to have a new branch that contains the revert of the revert, so I can make further changes and go back through the PR process.
Git Revert a Revert for a Merge
That's not how things are designed to work. You could theoretically clone the repository within a subdirectory of your original clone and mark that directory as excluded from the higher level repository, but wouldn't it be much simpler to just check it out in a completely different directory instead of a subdirectory? That is to say... /repo/master/(clone on master branch) and then another clone that's on the other branch /repo/gh-pages/(clone on gh-pages branch)
I have a git repository (at github.com) with two branches: master and gh-pages. I would like to have the gh-pages branch in a subdirectory, so that I don't need to switch branches every time. repo/ (content of the master branch) gh-pages/ (content of the gh-pages branch) Is that possible ?
git: put a branch in a subdirectory
Bitbucket provides this. You can keep the code private but make tracker public (anyone can view, create, and comment on issues).
I am going to release some beta version of my application to the community. Project is stored on GitHub in the private repository. I would like to allow this community to report bugs and place them directly on GitHub Issues tab - it's not provided by GitHub right now. Do you have any idea, how to cover this flow ?
How to have a private repository with public issue tracker on GitHub?
32 Open you repo and go to Settings. Click on Code security and analysis in the Security subsection. There you will find dependabot settings with a Disable button for turning off the automated advisories. The page is also available through direct link https://github.com/<USERNAME>/<REPO>/settings/security_analysis by replacing placeholders <USERNAME> and <REPO> with the corresponding identifiers. Note that disabling the advisories will negatively impact the security of your software and should be avoided for any software with production deployments. Share Improve this answer Follow edited Mar 1, 2022 at 10:20 cyberixae 90355 silver badges1717 bronze badges answered Feb 12, 2022 at 14:24 JobajubaJobajuba 1,08699 silver badges1717 bronze badges 2 3 "Dependabot alerts" button is "enable", but I still get alert emails. Why? – Marvin Xu Oct 17, 2022 at 1:16 @MarvinXu see my answer. I think that's the reason. – Hache_raw Oct 17, 2022 at 19:08 Add a comment  | 
GitHub dependabot security alerts may sometimes become a chore especially when an abandoned project that is no longer in active use receives frequent security advisories. Is there an option to disable the active security monitoring?
Disabling dependabot alerts for a repository on GitHub
git update-index --no-assume-unchanged application/config/config.php Notice the --no prefix, stylistically a double negation.
I just did the following to to keep a different copy of my config.php file in my localhost vs. my production environment: $ git update-index --assume-unchanged application/config/config.php Unfortunately, I didn't write the config.php file exactly as I should and I need to reverse this such that I can make the change, commit it, and then re-ignore the file. How do I undo the git update-index command?
How to undo git update-index?
There's even the possibility of checking out the "remote branch" directly, no need to create a local branch (git will say you are working on detached HEAD state), so, using Sajib's example: git fetch origin git checkout origin/whatever
I work as a part of a team. Our process is to create a separate branch, work on the separate branch, then push that branch to 'origin' and make a pull request to master. I am trying to get better with the default command line Git. Then another person makes a pull request on a branch. Is there an easy way to pull that branch to my local and check out the branch so I can test the code before approving the pull request?
How can I test a pull request before merging it?
Neither GitHub nor Bitbucket are SCMs -- they are just hosting services built around Git and Mercurial, which are the underlying SCMs. If your question is actually whether you should use Git/Mercurial as an SCM, then most people will answer "yes", but it sounds like you should read up on exactly what these are before diving in, since it sounds like you have quite a bit of confusion on the topic.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 13 years ago. I would like to host my code in the cloud. Which one would you recommend?
GitHub or BitBucket? [closed]
Do I have to "push" something after I make a tag? Yes: git push --tags (since GitHub releases are based on git tags)
So... I have a Git repository on my desktop computer that is linked to a GitHub repository. When I do: git tag -a -F C:\Users\Adam\AppData\Local\Temp\git-tag-message-4665532737910125701.txt v0.1 63f5 the tag doesn't show up as a release on the GitHub website. (Note: An IDE handles all of the Git->GitHub stuff for me) Do I have to "push" something after I make a tag?
Git tags don't show up as GitHub releases
Got it! The trick was to delete the Home page, but it was impossible to do directly from github. Here's a workaround: Go to wiki / Git Access and clone the wiki repository with the provided link. In the cloned repo just delete the file representing the Home page (in my case it was Home.md). Push the changes back.
I'm looking for a way to list all pages on the wiki Home page instead of the standard welcome message. Here's an example of what I want: https://github.com/yahoo/oozie/wiki
List all wiki pages on wiki `Home` page
Using the header method, you should be able to put "Authorization: token OAUTH-TOKEN" directly into the key input under the Headers section. Obviously replace OAUTH-TOKEN with your actual token. Edit: To illustrate the steps more clearly see the image below (a) in the key field, put in 'Authorization', (b) in the value field, put in 'token ' (do not include the <> brackets!) Looking at it in curl, it adds -H "Authorization: token <your token here>" to the request, which is what is needed.
I would like to get a list of public gists in Postman. I can do curl https://api.github.com/gists/public in my command line which works fine. However I did not manage to find out how to do the same in Postman. I tried to make a GET request at https://api.github.com/gists/public which returned the following object: { "message": "Bad credentials", "documentation_url": "https://developer.github.com/v3" } I find it confusing to not to be required to authenticate when making the request from command line but when I would like to do basically the same from Postman it throws an error. But ok, I tried to authenticate myself. I have created an OAuth application in my GitHub so I recieved a Client ID and Client Secret. I have tried to pass these to my requests as query params / header information / and also as part of the body without any success. I also have tried to use the web application flow (https://developer.github.com/v3/oauth/#web-application-flow), and tried to create a new authorization with sending a POST request to https://api.github.com/authorizations with my User ID and User Secret in it (https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization), which returned { "message": "Requires authentication", "documentation_url": "https://developer.github.com/v3/oauth_authorizations/#oauth-authorizations-api" } Now I am super confused about what should generate my token, and where should I pass it to. All I want is some public information (public gists) in Postman, the same as in command line.
How to use GitHub API in Postman
I do not know what github for Mac rollback does, but it seems that you would be better off using command line to resolve the issue at hand: git cherry-pick --abort - to stop any cherry-picking in progress git branch -va - will show you where are your pointers right now make sure your working directory is clean: git status - should not show any modified or staged files git stash - if anything modified still present git reset --hard your_local_branch github/remote_branch - make local branch reflect the state as it is on the remote side. obviously you don't need to do a reset if your current branch will point to the same commit as the remote. If you're in detached HEAD state (git status will tell you about it) then to come back to the normal state just checkout your local branch. Now decide what you actually want to achieve: I. get rid of the faulty commit? Use interactive rebase and remove the line with faulty commit, then force push to the remote repo on github (say faulty commit happened 10 commits ago) git rebase -i HEAD~11 II. revert faulty commit? - wouldn't recommend to do that after some other commits, unless you're absolutely sure that the following commits didn't touch the same piece of code. This will effectively create a reverse commit (if line was added by faulty commit it will be removed by revert and vice versa) git revert {commit-sha1} III. Amend faulty commit? use interactive rebase, but instruct it to stop at faulty commit for amending. When it does stop edit the change and continue rebasing, then force push to the remote branch (use rebase command from the solution I ) After you're done if anything was stashed use git stash pop to bring the changes back. hope that helps!
I think I've messed up here. I made a few changes to my code from a last commit adding new functionalities and realized that some other piece of code was now acting strangely. I decided to Roll back to an old commit (pushed to remote as well) in order to test if that functionality was working by then. Before I pressed Rollback, I committed my currently made changes because I did not want to lose them. After committing (not pushing to remote), I did the rollback to that old commit. (note that there were quite a few commits inbetween the commit i roll backed to and the one i committed just now). All worked fine and my code reverted to that commit. The functionality was misbehaving there in that commit as well so I decided to come back to my most recent commit. However, I knew not how to do that except Rolling Back to the latest commit. But it gave me an error. error: a cherry-pick or revert is already in progress hint: try "git cherry-pick (--continue | --quit | --abort)" fatal: revert failed (32768) Now, it seems like most of things are back but the current version of code isn't the same as my last commit. It is somewhere in between. =( What did I do wrong? [I'm not asking out of innocence, I know I did it wrong ;)] What was the right way of doing it? [I think I should have branched first]
Rollback to Previous Commit - Github for MAC (a revert is already in progress)
I've stated this in the comments to another answer, but it's really the answer (and I've edited the appropriate section of the comments into the question where it belongs). The URL for the remote was not configured correctly, for whatever reason. It's set to "[email protected]:", which is clearly missing the path, producing precisely the error you see. You need to reconfigure it correctly. You could simply edit .git/config, changing the appropriate line to contain the path. Or you could do this: git remote rm origin git remote add origin '[email protected]:rosdabos55/sample_app.git' You almost certainly made some small typo or careless mistake when you added the remote the first time - perhaps you hit enter in the middle of it, perhaps you typed a space after the colon. (For some reason, git does not appear to throw an error when you provide an extra argument after remote add <name> <url> - it just ignores it.) The upshot is that you didn't actually run that command, and you added a remote with an incomplete URL.
I recently set up a new account with github. I'm following a Rails tutorial from Michael Hartl online ( http://www.railstutorial.org/book#fig:github_first_page ) and followed his instructions to set up my git which were also inline with the setup instructions at github. Anyways, the "Next Steps" section on github were: mkdir sample_app cd sample_app git init touch README git add README git commit -m 'first commit' git remote add origin [email protected]:rosdabos55/sample_app.git git push origin master I got all the way to the last instruction (git push origin master) without any problem. When I entered that last line into my terminal, however, I got this error message: fatal: No path specified. See 'man git-pull' for valid url syntax. What might I be doing wrong? Here are the contents of .git/config (reconstructed by Jefromi from the output of git config -l pasted into a comment below): [user] name = Ross email = [REDACTED] [core] editor = gvim -f repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = [email protected]: fetch = +refs/heads/*:refs/remotes/origin/*
Git push origin master returns "fatal: No path specified."
```python print 'bar' ``` without spaces should work: from GitHub help page: Just wrap your code blocks in ``` and you won't need to indent manually to trigger a code block. As illustrated in hilz's answer below, you need to indent the ```` with the same indentation level + 2 spaces than your list. The content of the code block doesn't need to be indented. 1. foo ````python print 'bar' ```` 1. ````python print 'bar' ```` See this gist as an example:
In Github/MD, if we want to enable code block when it is a child of list, we need to intent it by 8 spaces. But how to make that code block has the syntax highlighting feature? The following code does not work as expected... 1. foo ```python print 'bar' ``` 2. bar
Markdown/Github: syntax highlighting of code block as a child of a list
Most open source projects, and many tags on github and other open VCS sites, follow a format called Semantic Versioning, linked also in the quote in your question. This is the versioning model that suggests: Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. The SEMVER recommendation has gone through a few revisions of its own, and at one point recommended prefacing a tag with a "v", but these days I believe it does not mention the practice. Nevertheless, many sites, projects and conventions have followed this former SEMVER practice, and haven't updated themselves to follow the newer recommendations. My own opinion is that it probably doesn't matter whether you start your tags with a "v" or not. But you may have an easier time using tools like sort if you don't.
This is the content at GitHub's right sidebar: Tagging suggestions It’s common practice to prefix your version names with the letter v. Some good tag names might be v1.0 or v2.3.4. If the tag isn’t meant for production use, add a pre-release version after the version name. Some good pre-release versions might be v0.2-alpha or v5.9-beta.3. Semantic versioning If you’re new to releasing software, we highly recommend reading about semantic versioning. I don't understand why prefix your version names with the letter v? Please explain for me, why prefix version names with letter v is best-practice?
Why GitHub suggest "prefix your version names with the letter v?"
git update-ref refs/Attic/handle-empty-fields refs/heads/handle-empty-fields As an alternative to preserving dead branches in tags you could use a separate refs namespace. The upside is that the tag list stays uncluttered. A downside is moving from the porcelain to the plumbing level of git.
What are the current best practices with git branches that have been created to test out a solution to a bug and have not been merged because the review process show that they are wrong or there are better solutions to the problem? An example. Project fizzbuzz has a bug report that reports a crash on empty fields. I create a new branch handle-empty-fields and make two commit to that branch, "solving" the problem. Then I submit that branch to the fizzbuzz project manager, linking it in the bug report. Somebody finds an error in my fix, writes another patch and that patch get accepted. Now the code in the handle-empty-fields my code is useless: it is not correct and cannot be applied any longer to the code, but it has been referenced in that bug report. What should I do? Keep the branch? I will quickly end up with dozens of abandoned branch and git has no way to mark a branch as abandoned or closed. Remove the branch? But then people looking at that bug report will find it and get 404. People are often suggested not to rebase their repositories because that will cause problems to other devs, especially downstream devs. What are the suggestions for feature or bug-fix branches? Update: it looks like github never deletes the commits contained in pull requests. So, if you push your changes an turn them into a pull request, you can later delete the branch without losing any of your changes. Well, while github is still working ;).
What to do with experimental non-merged git branches?
11 I found the repositories I've pushed code at https://github.com/settings/repositories Share Improve this answer Follow answered Nov 14, 2021 at 22:14 Pablo Manuel GonzálezPablo Manuel González 14511 silver badge44 bronze badges 1 10 This isn't showing all of the repositories – Sujal Singh Nov 10, 2022 at 6:15 Add a comment  | 
One of our team member create a repository and all other team member can push their own work to this repository. It seems that, under the tab "Contributions" there should be two kinds of directory: "Popular repositories" and "Repositories contributed to". I push my work to this repository from the user Interface of Eclipse. But in the home page of my github, directory "Repositories contributed to" was not shown up and all my push history can only be seen in the "Public activity". How can I make "Repositories contributed to" shown up so others can see my contribution to the team work? Thanks a lot!
How to show the "Repositories contributed to" on github
32 In general this is not possible, Github (pages) serves only static content (ex: HTML, CSS, JS). If you want python to run (ex generate dynamic content) you need a web server capable of running python (your browser were the contents of GitHub Pages get downloaded and run can't do it). That said there are experimental ways of running subsets of python in the browser. Take a look for a example at this question. Share Improve this answer Follow edited May 23, 2017 at 12:17 CommunityBot 111 silver badge answered Jun 19, 2014 at 1:25 elyaseelyase 40.3k1212 gold badges116116 silver badges120120 bronze badges 4 And what about angular material pages? – Nabin Oct 31, 2016 at 7:38 @NabinKhadka yes, that would be possible because angular is a frontend technology. The static code (HTML, CSS, JS) gets downloaded from GitHub to the browser and runs there. – elyase Oct 31, 2016 at 14:09 Thank you elyase. Will dig into it. +1 – Nabin Nov 1, 2016 at 2:53 Thank you elyase. Does this mean that in the case of GitHub pages serving static content, the browser is the HTTP server also in addition to being the client ? – tauseef_CuriousGuy Jul 9, 2020 at 19:16 Add a comment  | 
I want to run a python file in the web I have in a GitHub repository. Is it possible to do this? And by running in the web, I mean putting #!/usr/bin/python and print 'Content-type:text/html\n in the first two lines.
Is it possible to run python in the web with github.io?
When pushing, you always push one specific commit (usually the commit at the tip of your currently checked out branch). However, as the commit's hash partly consists of the commits it bases on (its parent commits), you have to push all parent commits also. And by pushing the parent commits you also have to push their parent commits and so on. So, you can only push the whole history of a specific commit. If you create a commit just to store something but not for pushing, you need to make sure that you never push that commit, nor any commits that base on that commit. To do that, after you have done your work that bases on the temporary commit, you need to squash the temporary commit into the new commit that you create to push it. In other words, yes it is possible to use a commit for temporary, private storage. However, it is much easier to use the stash feature. In fact, the feature is made for this very use case.
I changed some files in my repo, but don't want them to be pushed public or create any temporary branch to store them. I just want to save these changes in somewhere. So which command is better: git stash save "save message" or git commit -am "save message" ? If I use git commit, is it true that all of my local commits will be pushed publicly by one git push command? What if I just want to push one specific commit among them?
Use git stash save or git commit for local changes?
22 How to fork & patch npm modules Fork the project on GitHub. Clone the fork to your machine Fix the bug or add the feature you want. Push your commits up to your fork on GitHub (Use a branch if you wish to create a PR for the original repo). Open your fork on GitHub, and find and copy the SHA of the latest commit you made. Open up your package.json file, and replace MODULE, USER, REPO, and SHA with the info from the GitHub repo. "MODULE": "https://github.com/USER/REPO/tarball/SHA", eg: to get a tarball link from this commit "react-remarkable": "https://github.com/HelloKip/react-remarkable/tarball/9549e776136096b827f3a0823329ad997416e364", Run npm i to install the module dependencies. Profit! Adapted from debuggable.com and cmwelsh.com. Share Improve this answer Follow edited Nov 13, 2018 at 19:31 OroshiX 71411 gold badge88 silver badges2828 bronze badges answered Apr 6, 2018 at 0:04 Beau SmithBeau Smith 34k1414 gold badges9494 silver badges101101 bronze badges 6 7 This doesn't work for packages that need to be processed (e.g. via prepublish script) before consumption, does it? – jacobq Oct 16, 2018 at 17:36 @iX3 - Sorry, I don't know… but now I'm curious. – Beau Smith Oct 16, 2018 at 18:31 2 This is good info, but it doesn't answer the original concern about the package needed to be processed (transpiled, minified, etc.) before use. – GaryO Feb 24, 2021 at 18:07 2 This article explains how to compile your forked version using a postinstall script. link.medium.com/hljD5UiRdeb – el-lugy Feb 27, 2021 at 17:02 2 Basically this "scripts": { ... "postinstall": "cd ./node_modules/my-forked-project && npm install && npm run build" } – el-lugy Feb 27, 2021 at 17:03  |  Show 1 more comment
A high quality open source repo exists on GitHub and NPM, with a wide user base. I've forked the project and made a substantial extension. I think is ready to merge back. But (appropriately) its the project owner who gets to make that call not me. And it's now been several weeks without reply. Several users have asked on the repo issue discussion that this be merged back, and more have contacted me directly to publish to NPM as a separate project. Serious developers can get the new version via GitHub, but it has just the raw source, not the catenated/minified/tailored versions as the README says not to run make dist until it's merged back and the version number incremented. I think it should be as simple as creating a fork of this fork, and publishing that as a new NPM module. But GitHub doesn't allow me to do that ("You're already looking at this project") Is there a way that I can publish this as a new NPM module, but still retain the options for my fork to submit a pull request to the original my fork to fetch upstream changes from the original my sub-fork to fetch upstream changes from my fork (and thus the original) Do I create a new GitHub account under a new email address? Forking a fork of my repo in GitHub
Publish fork of GitHub project to new NPM module but keep option to merge with original?
The easiest way to do this would be to add a workflow to each repository that updates the corresponding area in Pages. I.e. in the "Main" repo, it would look something like: on: push jobs: main: steps: - name: Checkout uses: actions/checkout@v2 - name: Build run: TODO - name: Publish run: TODO And in the other repositories, you'd have something similar. For example in the Angular repository: on: push jobs: angular: steps: - name: Checkout App uses: actions/checkout@v2 - name: Build Angular run: | npm ci npm run build ng build --prod --base-href='angular' - name: Publish run: TODO If you wanted to only publish when you update Main, you could have a workflow in your Main repository that builds and publishes all three, e.g.: on: push jobs: main: steps: - name: Checkout repo uses: actions/checkout@v2 with: repository: my-org/main path: main - name: Build run: TODO working-directory: ./main - name: Publish run: TODO working-directory: ./main react: steps: - name: Checkout repo uses: actions/checkout@v2 with: repository: my-org/react path: react - name: Build React run: TODO working-directory: ./react - name: Publish run: TODO working-directory: ./react angular: steps: - name: Checkout App uses: actions/checkout@v2 with: repository: my-org/angular path: angular - name: Build Angular run: | npm ci npm run build ng build --prod --base-href='angular', working-directory: ./angular - name: Publish run: TODO working-directory: ./angular
Is there a way to setup Github Actions to run multiple npm run builds? I wanted to use multiple repos and set them as different webpages on the main site. Imagine I had 3 repos: Main, Angular App, and React App. The Main repo would have my landing site. Angular App and React App would be two different sites. From foobar.github.io (main repo), I would go to foobar.github.io/angular to navigate to my Angular App. foobar.github.io/react would be a react app. Each application would be in 3 different repositories. Is there a way for me to push to my Angular App and GitHub Actions would automatically do an ng build --prod --base-href='angular', and update that page or even run a build for all repositories and deploy it? To do this locally, I would have to do a build command on each repository, and then drag each prod folder into my repo, then push it up, which, in my opinion, can get very inefficient.
How to use GitHub Actions with multiple repositories and deploy to GitHub Pages?
10 This is not possible directly from the issue interface. I can try to provide you some workarounds and maybe start a debate why one would want this feature: Creating branches directly on the web interface After you've noticed that you need to start working on an issue you can just go to the repository main page (keyboard shortcut gc) and create a branch with the name you want: Chrome extensions If this is a must for you, you can create a chrome extension that augments the UI and creates a branch directly from the Issues WebUI using the GitHub API. There's a lot of open source extensions that augment the default WebUI. Is it the most efficient way to start a new feature? I think this changes from developer to developer, but having worked with GitHub for 7 years using Issues I've never felt the need for this feature because unless it's a one line change that doesn't require local testing or compilation, I still want to get down to my command line and IDE. If I have to do that, I still have to at least git fetch to get the branch I just created directly through the issue interface. If that's the case I've always preferred to just look at the issue and run git checkout -b branch-name, optionally with git push if my team needs to see the branch. Then the issue name wouldn't normally translate to a branch name, at least I wouldn't want that. So that option to create a branch from an issue would probably need to spin out a prompt to allow me to name the branch what I wanted. This is just my personal opinion and nothing else, hope it helps :) Share Improve this answer Follow answered Jan 12, 2017 at 15:17 bitoiubitoiu 7,13355 gold badges4242 silver badges6060 bronze badges 1 If you were to engage on Chrome Extensions the reply from @CJ above would help :) – bitoiu Jan 12, 2017 at 18:04 Add a comment  | 
Is it possible to create new branch directly from Issue which is posted on Github? We have project hosted on Github with many issues, it would be easy for us just to click one button in Issue web interface and create new branch for it to start developing.
Create new branch from the Issue
17 What you are trying to do is not possible. A tag, like a branch, can only point to at most one commit. Share Improve this answer Follow answered Jun 7, 2015 at 18:31 David DeutschDavid Deutsch 18.1k44 gold badges4848 silver badges5454 bronze badges 1 1 I used git tag -a V2.0 - m "My Message" <commit-id> , it added my head and this passed commit-id in this tag. Can you please explain ? – cafebabe1991 Jul 31, 2015 at 9:44 Add a comment  | 
I want to create a single tag for multiple commits(merged branches). Can we group multiple commits to a single tag , please help me on this.
How to tag multiple commits in git
9 No, GitHub doesn't let you restrict who can perform a merge. However, if you want to require a specific group of people to approve a PR before merging, use the CODEOWNERS file and require an approval from a code owner before merging in the branch protection settings. For example, if you want all changes to be reviewed by the core team, you can use this in your CODEOWNERS file: * @my-org/core Share Improve this answer Follow answered Jul 6, 2020 at 22:43 bk2204bk2204 70.9k77 gold badges9494 silver badges108108 bronze badges 2 3 but this will make every new branch created after that to request a review from code owner even though the base branch is not master – Teju Amirthi Mar 23, 2022 at 17:10 1 not AFAIK. the "Require review from Codeowners" is part of the branch protection rules, so it applies only to the branches (or branch pattern) you define in the protection rule. So you can restrict this to your main branch – Sebastian Oct 3, 2023 at 20:28 Add a comment  | 
I have setup on my Github repo a branch protection rule on master branch checking (activating) the following: Require pull request reviews before merging Required approving reviewers : 1 Include administrators Restrict who can push to matching branches I'm then in a situation that at least one from the team must approve a PR before someone can merge its own dev branch to master. Apart from the above I would also want to select only some people that will have the permission to merge the reviewed and approved PR. Not everyone having access to the repo. Is it possible to set this up?
How to restrict who can merge to master on a github repo?
I don't know anything about the requirements for Heroku - hopefully Justice is right and you can simply avoid the problem. If you can't, or if someone else finds this who can't... If you want the two remotes to be mirrors (have the same commits), they must by definition have the same files in those commits. So, you have two choices: have file-for-repo-B in all repositories, even if they don't need it, or use a slightly messy workflow with two branches: master and for-repo-B. The only difference between the two branches would be the commits touching file-for-repo-B; the branch for-repo-B would always merge from master (but never the other way around!). Now you just have a different branch checked out in repo B, and all is good.
Is there a simple way to setup different .gitignore files for different remotes? I have a repository I push up to both Heroku and Github. I need database.yml for Heroku, but don't want some of the information to be pushed up to Github. So I need a different .gitignore file for each of the remotes. I tried having two separate branches, one that ignores database.yml, and one that doesn't. The problem is that when I checkout the heroku branch and go back into my github branch, the entire database.yml file is gone. Any tips?
Is there a way to setup remote-specific .gitignores?
3 You can version jupyter notebooks directly using kyso.io (disclaimer: I founded kyso). Kyso supports the Jupyter format fully so you can render them nicely, and have proper versioning, diffing and merging of .ipynb files. Share Improve this answer Follow answered Jun 26, 2017 at 9:20 Eoin MurrayEoin Murray 1,94533 gold badges2222 silver badges3434 bronze badges Add a comment  | 
I have hosted jupyterhub on a server and added many users into it. I want the users to have an option of version control for their work. So is there any way to add a git kernel or extension do have this done?
Is there a way to integrate git with Jupyter and have a version control over the notebooks created?
That solution is not so far from what you tried. This works only if your different projects have no common files (otherwise it can be difficult to solve conflicts) # create a new repo: git init all_projects cd all_project # to make it more easy to understand, let's create a new branch git checkout -b main # import 1st project git remote add projectA http://projectA git fetch --all --tags git checkout masterA projectA/master git rebase masterA main # move the main branch to the current state git branch main -f # Now your branch main is at the same state as your A project # import 2st project git remote add projectB http://projectB git fetch --all --tags git checkout masterB projectB/master git rebase masterB main # move the main branch to the current state git branch main -f # Now your branch main contains all commits from projectA and projectB # etc.. The result will be a repository with 1st all commits from project A, then all commits from project B, even if the project B has some commits dated before the last commit of project A, but this should not be a problem (and the history tree will be easier to read) EDIT : Sorry I just notice this not solve your problem to get all remote branches. Maybe you can find a solution based on that question, with something like this: for i in $(git branch -r |grep projectA|awk -F'/' '{print $2}'); do git checkout $i projectA/$i git rebase $i main done but this would make your tree more complex because all branches will starts from the main commit ..
I have four separate projects. They have their own git repository. and the same name of branches for all projects. /project/ /project/projA/ /project/projA/.git/ /project/projB/ /project/projB/.git/ /project/projC/ /project/projC/.git/ /project/projD/ /project/projD/.git/ All git repositories have the same name of branches, and of course their own master branch. Question I would like to merge all projects into one like so: /Project/.git/ /project/projA/ /project/projB/ /project/projC/ /project/projD/ But i want to keep the history of all branches. ps -> i have the same name of branches for all repo. for exemple: a branche name used for all four project: V6-004 Details I tried submodule and subtree but the both doesn't solve the issue. I tried also this. $ mkdir new_parent_project $ cd new_parent_project $ git init # Now we need to create the initial commit. This is essential. $ touch README.md $ git add README.md $ git commit -am "initial commit" after # merge project ProjA into subdirectory ProjA $ git remote add -f ProjA http://GitUrl $ git merge -s ours --no-commit ProjA/V6-006 $ git read-tree --prefix=ProjA/ -u ProjA/V6-006 $ git commit -m "merging ProjA into subdir: ProjA" after # merge project ProjB into subdirectory ProjB $ git remote add -f ProjB http://GitUrl $ git merge -s ours --no-commit ProjB/V6-006 $ git read-tree --prefix=ProjB/ -u ProjB/V6-006 $ git commit -m "merging ProjB into subdir: ProjB" but the projects are merged but i have only the history of V6-006. but i don't have history for the others branches.
Merge multiple git repositories into one, keeping branches history
This (include the submodule with a GitHub zip or tarball download: the Nodeload service) isn't currently supported, as mentioned in this thread. This script revision would make the zip itself from a GitHub repo, including submodules, through multiple calls to https://nodeload.github.com/user/repo/zipball/branch.
I have a GitHub repository and use another project as a submodule. This submodule is also in .gitmodules, the code below: [submodule "inc/tha"] path = inc/tha url = git://github.com/zamoose/themehookalliance.git See also in view on GitHub. How is it possible to download my GitHub repository, including the submodule files?
Include a GitHub submodule automatically in download
Whenever this randomly happens to me, removing and adding heroku again as a remote reference always works. First check if you do have heroku as a remote. git remote -v If heroku is present, remove it. git remote rm heroku Then add it back. git remote add heroku [email protected]:project.git Usually this works with me, try it and let me know what happens.
I have a few apps on Heroku, nothing has had this problem but I suddenly have had issues running git. Now I can't deploy my app to Heroku. When I run git push heroku master I get the following: fatal: unable to access 'https://git.heroku.com/<herokuappname>.git/': Could not resolve host: (nil); nodename nor servname provided, or not known When I run git remote -v I get the following: heroku https://git.heroku.com/<herokuappname>.git (fetch) heroku https://git.heroku.com/<herokuappname>.git (push) I've looked up everything. Please help, thank you.
Cannot push to Heroku 'fatal: unable to access..Could not resolve host: (nil); nodename nor servname provided, or not known'
Append ?w=1 to the URL on any github.com page that is showing a diff and it will ignore whitespace. See this blog post.
Is there a way to display a commit on github.com without showing whitespace changes? Is there a way to display that from console? i.e. clone and then look at commit (tree) locally ignoring all white space changes? I use Trac extensively; I'm looking for something similar to Ignore White space changes (which can be found on the changeset view).
View commits without whitespace changes on GitHub
A bit easier: git remote set-url origin https://github.com/LongKnight/git-basics.git That will replace the current origin with a new one.
I can not create origin remotely with remote command: $ git remote add origin https://github.com/LongKnight/git-basics.git fatal: remote origin already exists. To solve the error, I have tried this: $ git remote -v origin $ git remote -v show origin It is not uploading the files from my local repository to the remote: $ git push -u origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Does each repository have its own origin? Solution: I was using the Powershell that came with Github or Git Shell as it is also called to do my tutorial, once I switched to Git Bash it worked fine.
Git - fatal: remote origin already exists
Anyone who clones the git repository will be able to see the email address you made the commit with. If you add .patch to any commit URL you will see the raw commit data (including the commiter's email). For example: https://github.com/kennethreitz/requests/commit/c8f166f696327d.patch
This question already has answers here: Does Git publicly expose my e-mail address? (9 answers) Closed 8 years ago. I noticed that in my commits to github there is my email address. I couldn't find this email address appear anywhere on github, but I was wondering if it could appear anywhere and be crawled by bots for spam? If so, is that possible to remove the email address and not have it in the commits anymore? Note: the project is open and public on github (not private repository)
Are git emails of authors in commits publicly readable? [duplicate]
In the end, I implemented this in my C++11 git-ws plugin. string currentBranch = run("git rev-parse --abbrev-ref HEAD"); bool canCommit = run("git diff-index --name-only --ignore-submodules HEAD --").empty(); bool canPush = stoi(run("git rev-list HEAD...origin/" + currentBranch + " --ignore-submodules --count")[0]) > 0; Seems to work so far. canPull still needs to be tested and implemented. Explanation: currentBranch gets the console output, which is a string of the current branch name canCommit gets whether the console outputs something (difference between current changes and HEAD, ignoring submodules) canPush gets the count of changes between origin/currentBranch and the local repo - if > 0, the local repo can be pushed
I'm developing a git plug-in, and I need to know when a local repo is changed (can commit changes), ahead (can push to remote) or behind (can pull from remote) using the command line. This is what I am doing so far: Can commit? If git diff-index --name-only --ignore-submodules HEAD -- returns something, then yes, there are changes to commit. Can push? If git status -sb contains the word ahead in it's output, then yes, there are commits to push. Can pull? Nothing implemented yet. The can commit? part seems to work properly. Can push? only works for the master branch, and this is a huge problem. How can I safely check if, on every branch, a git repo has changes to commit, commits to push, or needs a git pull?
Check if local git repo is ahead/behind remote
As can be seen, it is surely possible. dog | bird | cat ----|------|---- foo | foo | foo bar | bar | bar baz | baz | baz (this is using GitHub's "Markdown" Edit mode)
What's the easy way to type wiki document in Github with header and table? Here is what annoying to me: If I use Markdown, I have to use <table>. If I use Textile, there is no # or ## for header I like the |col1|col2| syntax though. What people use for this scenario? Without lots of typing / cut and paste (for <table> as example).
Github Wiki's table and header
46 Go to step #6 directly [follow from step #1 if you have single sign-on] Generate an SSH key in your local machine (enter passphrase while creating key) ssh-keygen -t rsa Copy the public key which starts with ssh-rsa Go to Github > settings > SSH and GPG keys Click on New SSH key and paste the private that you've copied earlier, and create it Now, enable SSO and authorize your org Make sure that the newly created ssh private key is added into the SSH authentication agent ssh-add <your-private-key> (e.g., ssh-add id_rsa) Note: By default, it will have your id_rsa primary key only; so, you need to add your custom private key in it. Share Improve this answer Follow edited Dec 9, 2021 at 7:11 lkahtz 4,74688 gold badges4747 silver badges7474 bronze badges answered Feb 10, 2020 at 8:04 Prashanth SamsPrashanth Sams 20.5k2020 gold badges102102 silver badges126126 bronze badges 2 5 Correction to Step 2: Copy the public key (NOT private) which starts with ssh-rsa. The public key file should end in .pub; the private key should lack any .pub file ending and its contents should clearly show -----BEGIN OPENSSH PRIVATE KEY-----. DO NOT EVER give your private key to 3rd parties such as Github. -- Also, since you should only be pasting your public key, you don't have to blur out the summary info about that public key as long as your private key isn't compromised. – George Pantazes Jul 29, 2021 at 19:25 2 I have followed this tutorial, and successfully added my private key to GitHub. But when using: git push https://<GITHUB_ACCESS_TOKEN>@github.com/<GITHUB_USERNAME>/<REPOSITORY_NAME>.git My password is still demanded, and the prompt ask for a token identification. ssh-rsa0 Has anyone experienced the same issue? – Drosera_capensis May 13, 2022 at 15:33 Add a comment  | 
Git is throwing error "C:\Program Files (x86)\Git\bin\git.exe" push -u --recurse-submodules=check - -progress "origin" refs/heads/dev_civaplugin:refs/heads/dev_civaplugin remote: Password authentication is not available for Git operations. remote: You must use a personal access token or SSH key. remote: See https://github.build.ge.com/settings/tokens or https://github.build.ge.com/settings/ssh fatal: unable to access 'https://github.build.ge.com/108012572/NextGenUT.git/': The requested URL returned error: 403 Done Press Enter or Esc to close console... I cloned remote repository successfully using git extention and able to create new branch also but when tried to push my changes its throwing above error. I created public and private key using Tools> putty> generate or import key my pc don’t have > .SSH folder in user In git hub I created Personal access token also using Settings > Developer settings > Personal access tokens Not getting clear idea of what the issue is, any input is a great help
Git push is not working Error "You must use a personal access token or SSH key"
29 There's no way to merge without resolving conflicts. Otherwise, how would git know what to merge? You can, however, checkout the version from either branch you're merging using git checkout --ours <filepath> or git checkout --theirs <filepath>. Here's an example: Suppose you're on the master branch merging in staging: git checkout master git merge staging And git shows a bunch of conflicts: ... CONFLICT: Readme.md ... If you want to keep the version of Readme.md that's on master, then you would run: git checkout --ours Readme.md Note that since you're on master --ours refers to "this" branch, i.e. master. Now, you can simply add it to the index to mark it as resolved: git add Readme.md This effectively ignores any changes to Readme.md on the staging branch. You can repeat this process for each file you want to omit from the merge. When you're done, commit as you normally would: git checkout --theirs <filepath>0 In order to repeat it for all files with conflicts you can do git checkout --theirs <filepath>1 Share Improve this answer Follow edited Jul 12, 2018 at 9:09 mr.tarsa 6,47433 gold badges2626 silver badges4545 bronze badges answered Apr 24, 2016 at 7:46 Anthony EAnthony E 11.2k22 gold badges2626 silver badges4545 bronze badges 3 3 Warning: git checkout --theirs <filepath>2/git checkout --theirs <filepath>3 doesn't merge changes, it takes one version of the file verbatim, completely ignoring the other. – ivan_pozdeev Apr 26, 2016 at 18:36 Even worse, git checkout --theirs <filepath>4/git checkout --theirs <filepath>5 does nothing. – q9f Oct 20, 2017 at 21:10 4 @5chdn it definitely checks out versions from the specified branch, as described in ivan's comment – Felipe Jan 20, 2018 at 4:15 Add a comment  | 
I'm trying to merge a pull request that has one conflict in one file (see below). The instructions for merging the pull request are provided by github are as follows. Its important to to perform this merge so the person submitting the pr gets credit for it. # Step 1: From your project repository, check out a new branch and test the changes. git checkout -b droark-master master git pull https://github.com/droark/cryptopp.git master # Step 2: Merge the changes and update on GitHub. git checkout master git merge --no-ff droark-master git push origin master I know how to fix the one line in the one conflicting file. What I don't know how to do is make Git perform the merge and stop complaining about broken index files. How do I make Git perform the merge, ensure the person who provided the pull request gets credit for it, and stop breaking index files? I tried to repair the merge with Git merge errors. One set of errors turns into another set of errors, ad infinitum. I also tried resetting the problem file according to Ignore files during merge with plans to copy/paste the one line needed, but the broken index persists. This has turned into a complete waste of time, and I am no longer interested in trying to do it Git's way since it wastes so much time. Now I simply want Git to perform the merge and stop breaking index files. Here is the output produced when merging using github's instructions: $ git pull https://github.com/droark/cryptopp.git master From https://github.com/droark/cryptopp * branch master -> FETCH_HEAD Auto-merging validate.h Auto-merging validat2.cpp Auto-merging validat1.cpp Auto-merging test.cpp CONFLICT (content): Merge conflict in test.cpp Auto-merging pubkey.h Automatic merge failed; fix conflicts and then commit the result.
How to force a merge to succeed when there are conflicts?
When you download the repo it just gives you all the source files with no .git so you dont have the repo. When you clone you get a copy of the history and it is a functional git repo.
This question already has answers here: What's the difference between cloning and copying a git repo? (2 answers) Closed 8 years ago. I have started using GitHub recently. I would like to know the difference between cloning and downloading a GitHub repository. Does they both lead to making a copy of the repository?
Difference between cloning and downloading [duplicate]
32 cd into "new" repository git remote add origin [email protected]:myusername/myrepository (replacing myusername & myrepository accordingly) git push --force origin master Possibly delete other remote branches and push new ones. This will forcefully replace everything in the remote repository with what you have locally. Be very careful, there is no going back. Share Improve this answer Follow answered Dec 11, 2011 at 2:34 Andrew MarshallAndrew Marshall 96k2020 gold badges222222 silver badges217217 bronze badges 8 4 Keeping in mind that until something runs git gc the old orphaned blobs will still all be there using up space. – Chris Eberle Dec 11, 2011 at 2:36 @Chris of course, but obviously those shouldn't be depended on for rolling-back, and there's not much that can be done about them when you don't have control of the server. – Andrew Marshall Dec 11, 2011 at 2:39 The point being that on a server like github which has storage limits, just because you think you got rid of your old code doesn't mean it's not still there eating up space. I'm not disagreeing, your instructions are close to what I'd do, I'm just pointing out the downside of doing it this way. – Chris Eberle Dec 11, 2011 at 2:42 @Chris Ah, I see, didn't think about the quota implications. – Andrew Marshall Dec 11, 2011 at 3:29 1 @Suragch It intentionally does not. – Andrew Marshall Dec 22, 2016 at 8:16  |  Show 3 more comments
I have a repo on GitHub with a lot of issues there. I want to replace the entire code base of that repo with a new one but I want to keep all the previous information. What's the best way of doing that without messing up the code nor GitHub?
Replace GitHub repo while preserving issues, wiki, etc
Git, like most version control systems, is eminently well suited for use by multiple developers. Indeed, it is one of the main points of a version control system. There is no need to create a branch per user. I would even go so far as to say that it would be counterproductive. If you are working on the same feature, you will probably want to get each other's changes, by pulling and merging. Creating branches per user is redundant and will complicate things unnecessarily. The commit situation you describe is not problematic. If another user has created a new commit on the same branch as you, you will be stopped if you try to push. Instead you will first have to pull down the other user's commit and merge (or rebase) your work with those changes. This is the standard behavior of git pull. Normal practice is to create branches based mainly on features. If you want guidance on branching, this is a popular strategy.
I've used Git only for sole projects. Now I want to continue working on a project with two other developers. Would it cause problems if one developer wants to commit changes but another commit was created by another developer? Therefore would it make sense to create one branch for each of us?
Does it make sense to create a branch for every developer?
They have a detailed blog entry up on how it works (HTML5 History API) here: https://github.com/blog/760-the-tree-slider
GitHub seems to be doing something incredible: animated page changes without breaking state. The address bar changes, but the page doesn't refresh and I get animated to the next view. For example, hit this URL: as3logback/ then hit this URL: as3logback/lib How in the devil are they doing it!?! It's so cool! Are they using some sort of frame or something serverside?
How do I do awesome refreshless page changes like GitHub do?
Try this (as described in the API docs here): http://api.github.com/repos/:owner/:repo/commits?path=PATH_TO_FILE e.g. https://api.github.com/repos/izuzak/pmrpc/commits?path=README.markdown Extra: Get commits history for one file from a specific branch (1) Get Branch SHA hash: Syntax: https://api.github.com/repos/:owner/:repo/git/refs Example: https://api.github.com/repos/izuzak/pmrpc/git/refs Grab the object.sha for a specific branch, e.g. refs/heads/gh-pages (2) Make the request using the extra sha=BRANCH_HASH parameter: Syntax: https://api.github.com/repos/:owner/:repo/commits?sha=BRANCH_HASH&path=PATH_TO_FILE Example: https://api.github.com/repos/izuzak/pmrpc/commits?sha=0a8e26a92ee3101803314ee7dea6c6057ff2b862&path=apidocs.markdown
I would like to get all commit messages for separate file in github REST api. But all I got - only to get all commits for separate branch. Then I tried to get following: http://api.github.com/users/<username>/<project>/commits/<branch>/<path/to/file> But that didn't help also. Is this at least possible?
Is it possible to get commits history for one file in github api?
Unfortunately, github-flavoured markdown doesn't support rendering of mermaid graphs. See this issue for more information and finding comfort in other peoples quest of this feature ;) If your are using VS Code, you can use this extension to preview your mermaid code blocks inside markdown but note that this does not render once you put it on github. To include the chart on github you will have to render it to a file, though someone suggested somehow using the online mermaid editor to render it and retrieve an URL to a rendered version. Actually, let me try to insert the example chart from the link on the previousely mentioned page... and, no. We get a Failed to upload image; the format is not supported-error. So you will need to save it as an image first.
I'm trying to render a flowchart in a markdown file using Mermaid to place into a ReadMe.md file in my GitHub repository. In this link (https://unpkg.com/[email protected]/README.md), there's an example code snippet for the Mermaid installation: ``` https://unpkg.com/[email protected]/dist/ ``` I included that code, then tried to make the flowchart in the next code snippet: ``` graph TD; A-->B; A-->C; B-->D; C-->D; ``` But all it does is print that text out in the markdown file when I preview it. How can I achieve my stated results or is not possible?
How to install Mermaid to render flowcharts in markdown?
26 You cannot create a repo on github using git bash. Git and github are different things. Github is a platform that let's you host and collaborate on code while git is the version control tool used. You can read more about them on wikipedia articles: github and git. However if your intention is to create a github repo using terminal, you can do it using the github api and curl. Share Improve this answer Follow answered Jul 27, 2012 at 19:23 KonarakKonarak 27333 silver badges77 bronze badges Add a comment  | 
How can I create a new repository from my machine using git bash? I followed the below steps: mkdir ~/Hello-World cd ~/Hello-World git init touch README git add README git commit -m 'first commit' git remote add origin https://github.com/username/Hello-World.git git push origin master But I'm getting "Fatal error: did you run update-server-info on the server? "
How to create a new repo at Github using git bash?
If you know the exact file path, you can use list commits on repository API specifying a path which only includes commits with this specific file path and then extract the most recent commit (the most recent is the first one) : Using Rest API v3 https://api.github.com/repos/bertrandmartel/speed-test-lib/commits?path=jspeedtest%2Fbuild.gradle&page=1&per_page=1 Using curl & jq : curl -s "https://api.github.com/repos/bertrandmartel/speed-test-lib/commits?path=jspeedtest%2Fbuild.gradle&page=1&per_page=1" | \ jq -r '.[0].commit.committer.date' Using GraphqQL API v4 { repository(owner: "bertrandmartel", name: "speed-test-lib") { ref(qualifiedName: "refs/heads/master") { target { ... on Commit { history(first: 1, path: "jspeedtest/build.gradle") { edges { node { committedDate } } } } } } } } Try it in the explorer Using curl & jq : curl -s -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type:application/json" \ -d '{ "query": "{ repository(owner: \"bertrandmartel\", name: \"speed-test-lib\") { ref(qualifiedName: \"refs/heads/master\") { target { ... on Commit { history(first: 1, path: \"jspeedtest/build.gradle\") { edges { node { committedDate } } } } } } } }" }' https://api.github.com/graphql | \ jq -r '.data.repository.ref.target.history.edges[0].node.committedDate'
I'm able to get the file contents (and if it's a folder, I'm able to get the list of files) by using the GitHub v3 API. Example: https://api.github.com/repos/[Owner]/[Repository]/contents/[Folder] But how can I know when the file was last updated? Is there an API for that?
Get when the file was last updated from a Github repository
You have a field called repository in package.json. If not, you can make it yourself. Add the GitHub repository URL there: "repository": { "type": "git", "url": "https://github.com/your-user/repo-url.git" }, Make sure you specify git as type and that the URL is pointing to the actual repository, not an HTML page. So the URL has to end with .git. You can copy/paste the URL you find when you click the Clone or download button on GitHub. There is also a field called homepage that you can use to point to the repository landing page. The documentation is here, by the way.
I need to add an link of my github repository to my npm package. I did not find the solution yet on the npm documentation.
how to add link of my github repo to npm package?
23 If clearing your local cache isn't fixing the image, the problem is likely that it was cached by Github as a part of their image URL anonymization process. You can force Github to clear their cache of the image with the following curl command. Change the example URL to the one from the your repo, it will always be https://camo.githubusercontent.com/ followed by a long hash. curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223.... Source: GitHub Help: About anonymized image URLs Share Improve this answer Follow answered Jun 30, 2019 at 14:22 iamdefinitelyahumaniamdefinitelyahuman 40144 silver badges55 bronze badges 3 That returns a forbidden page – Onno van der Zee Dec 29, 2020 at 15:18 3 This worked for me, December 2022. – DannyB Dec 24, 2022 at 20:15 I was wondering why my NPM Version Badge wasn't updating and was inspecting the HTML element and saw that the img src was at camo.githubusercontent.com and guessed it was some sort of proxy-cache, so like a server-side cache that can't be resolved client-side. I had no issues running the curl -X PURGE on the src URL, getting a successful response: { "status": "ok", "id": "4120-1688343712-210422" } Then I did a hard refresh in my browser (Firefox, Ctrl+F5) and could then see the up-to-date badge image. – Steve Goossens Jul 14, 2023 at 16:12 Add a comment  | 
I am trying to use coveralls.io to show a coverage badge for my tests, but the coverage badge is stuck on "unknown". The relevant repo is here: https://github.com/cfogelberg/grunt-set-app-mode When I look at coveralls.io for that repo I see the same "coverage: unknown" status: coveralls.io/r/cfogelberg/grunt-set-app-mode However, the individual builds are being correctly sent to coveralls.io: https://coveralls.io/builds/788669 What am I missing?
Why is my coveralls.io badge not updating even when the builds are happening?
28 Instead of merging you want to rebase. You can do this manually, or automatically when pulling. git pull --rebase upstream master git push --force origin master Once you've started doing merges though this will get hard to do, you'll need to reset the branch back to before you did a merge commit. Share Improve this answer Follow answered May 11, 2011 at 18:47 ArrowmasterArrowmaster 9,22122 gold badges2929 silver badges2525 bronze badges 2 This one seems work. I am just not sure if I have to do step two, since every time I merge with remote master there will be a merge commit. – Ivan Xiao May 16, 2011 at 18:17 8 -1 for the git push --force solution to be offered on the same level as git push --rebase. User needs to be warned of the possible pitfalls with push --force which is potentially more damaging, and other users of the repo must know how to react correctly if they branched off a commit that was entirely removed by the push --force and want to merge back – prusswan Nov 22, 2011 at 8:37 Add a comment  | 
I forked a project on Github. Let the remote upstream be upstream and my remote repository be origin. My local master branch is set to track the remote master branch. Then I added some stuff in local master, and I merged with the upstream every now and then. Not until today when I want to issue a pull request did I find the problem: the pull request consists those merge commits, and those unwanted commits that I did previously without care. However what I want is just to submit the last commit I did, which should be pulled as a single commit. What can I do to rescue this?
Avoid unwanted merge commits and other commits when doing pull request on GitHub
42 This helped me: 1 Re-enable git config --global http.sslVerify true to get rid of the "TLS certificate verification has been disabled." 2 Create a personal access token on GitHub: https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token 3 When prompted to enter credentials, used my email as user and the personal access token as password 4 To delete a wrong credential follow Where is github authentication token stored on Windows? Share Improve this answer Follow answered Jul 5, 2021 at 9:53 user16382594user16382594 42144 silver badges33 bronze badges 1 This solves the issue but is generally considered dangerous as disabling http.sslVerify exposes to man-in-the-middle attacks. – DataBach Sep 19, 2022 at 14:31 Add a comment  | 
I am trying to clone a repository from Github but I couldn't clone the repo, its failed with TLS certificate verification has been disabled! error. When I run the git clone command, it redirects to signin on Github its failed with TLS certificate and authentication failed for repo even though enter valid credential. My Github account is enabled with two-factor authentication. I have tried with disabling sslverifcation also git config --global http.sslVerify false Github error message: System specification: OS: Windows 10 Architecture: 64bit Please help me on this. Thanks in advance.
Github - TLS certificate verification has been disabled! on Windows
I guess there were many changes over the years and you can find outdated ways all over the web. The actual way is documented in the Dependabot documentation if: ${{ github.actor != 'dependabot[bot]' }} Note that nowadays you can also check the github.triggering_actor - if you want workflow to be skipped if Dependabot triggered it, but want to be able to manually trigger it on a PR that was opened by Dependabot.
I have a repository with Dependabot in it, that opens PR on version updates, etc which I would like to keep. In the same repository, I have a GitHub Action for Pull Requests for my team to use. My issue is that the Dependabot keeps triggering the Pull Request action no matter what I tried. My PR action have to be triggered on staging branch pull requests, like so: name: Pull Request on: pull_request: branches: - staging So I can't use both on pull_reuqest AND branches_ignore - as stated in the documentation Workflow attempts I have tried so far that unfortunately haven't worked: name: Pull Request on: pull_request: branches: - staging - '!dependabot/**' name: Pull Request on: pull_request: branches: - staging jobs: Build: if: github.actor!= 'dependabot-preview[bot]' name: Build runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v2 I have also tried excluding the Dependabot user like so: if: github.actor!= 'depbot' Would love some insights or answers on how you have dealt with this issue. Thanks!
GitHub Actions - Ignore or exclude Dependabot Pull Requests
They seem to have changed this since Aug 8 '12, so now all I had to do to reference my pdf file inside the Documentation folder (which is in my project's root) is this: [file.pdf](Documentation/file.pdf) So, no need to add blog/master part anymore. Hope it helps new people browsing this question.
I am trying to create links in my README.md that link to example code using a relative path, as opposed to the absolute path I am using now. For example, in the markdown file, if I use this: [someLabel](https://github.com/username/repoName/somePathTo/myExampleCode) It works no problem. But I would like to link it up using something like this: [someLabel](username/repoName/somePathTo/myExampleCode) This does not link up, as it gives me the ol' 404 not found error. Is there a way to link my examples on Github to my README using a relative path?
Linking using relative path on Github README.md
You need to reset the head to the commit just before your current head. git reset --hard <commit_before_merge> E.g. git reset --hard master^
I have been working in PhpStorm on a dedicated branch, but when pushing to github, I inadvertently merged to the master branch. How would I undo the merge both in github and locally? The github master is used to migrate code to various servers so I need to rollback to the previous commit prior to the merge rather than create a new commit with my changes undone.
How to undo a merge in GitHub
25 github has a link to download a .zip archive of the repo, so try using wget https://github.com/[user]/[repo]/archive/[branch].zip with [user], [repo], and [branch] replaced with the appropriate fields. Share Improve this answer Follow edited Mar 20, 2017 at 12:47 intropedro 2,80411 gold badge2525 silver badges2525 bronze badges answered Dec 17, 2013 at 21:50 randomusernamerandomusername 7,9572424 silver badges5050 bronze badges 2 Through the API, you could get a tarball instead of a zipball as well. article API reference – Charlie Dec 17, 2013 at 21:59 @Charlie Very true, but the OP asked for a solution with wget so that's what I gave them. – randomusername Dec 17, 2013 at 22:00 Add a comment  | 
Is there a way to download the contents of a git repo from the Unix command line that doesn't pull down everything in the .git directory? I just want the latest version of the repo directories and files, not all the diffs. Also, is it possible to accomplish this without using a git command (perhaps with wget or curl, for example)? Thanks.
Download Git repo without all the .git stuff?
do git pull origin monty_svm_dev first What has happened is that the remote has more recent changes than your branch. So before you can push your changes, you need to get and merge the changes on the remote first. You can do this either by doing a git checkout your_branch, then: git fetch origin your_branch and then a git merge your_branch or git pull origin your_branch # fetch and merge in one operation Where your branch is master, or your branch name (seems to be monty_svm_dev in your case I think) Once this is done (and any conflicts resolved) you can do a git push origin monty_svm_dev
How do I resolve this issue? I am trying to commit but I get the below error. git push origin monty_svm_dev To [email protected]: ! [rejected] monty_svm_dev -> monty_svm_dev (non-fast-forward) error: failed to push some refs to '[email protected]:/mygit.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. root@li409-202:~/mypath#
Git non-fast-forward updates were rejected Merge the remote changes
17 We need to install Git to use the Git History (git log) extension in VS Code. Otherwise we will see this when running git log. If you have already installed Git, then make sure that it is available from the shell, for example by typing git --version. Once you have Git installed properly, you will see this when running git log. Share Improve this answer Follow edited Mar 2, 2017 at 5:32 answered Mar 2, 2017 at 5:18 Shaun LuttinShaun Luttin 137k8585 gold badges421421 silver badges477477 bronze badges 5 I have been using github for desktop until now. I have git version 2.11.0.windows.3 according to git --version command from git shell. but I still get the error.. – dapidmini Mar 2, 2017 at 6:20 2 It's a shame that when you click "Dependencies" for Git History in Visual Studio Code, that it does not say please also install Git. This can be killer for newcomers who are trying to learn the system. – klewis Apr 30, 2017 at 20:59 I am getting this error from within VS Code when running a certain npm install module. This is the first time I have noticed this error, but as yet I do not have GIT installed. I would not have imagined GIT is a requirement to install modules... I could be wrong here. – Taersious Sep 12, 2019 at 16:46 1 I just installed the latest version of Git, but still the same, PATH environment variable has not been set. This could be due to that, we choose to use MinTTY during the Git installation. – Antonio Ooi May 20, 2020 at 8:10 UPDATE: Git's MinTTY terminal emulator option now also set PATH environment variables. Just restart your VS Code (or whatever terminal that you use) and type git --version. – Antonio Ooi May 20, 2020 at 8:20 Add a comment  | 
I get the error Error: spawn git ENOENT when I try to view git history using https://github.com/DonJayamanne/gitHistoryVSCode on VS Code.. I'm very new to VS Code and github. I tried googling for solutions but I only found links about node.js which I don't understand at all..
VS Code Error: spawn git ENOENT
As of December 27, 2009, you can completely opt-out of Jekyll processing by creating a file named .nojekyll in the root of your pages repo and pushing that to GitHub. This should only be necessary if your site uses directories that begin with an underscore, as Jekyll sees these as special dirs and does not copy them to the final destination. https://github.com/blog/572-bypassing-jekyll-on-github-pages
I have an issue with gh-pages of github. The html pages which start with _ ( underscore ) shows the error. Page does not exist! Read the Full Documentation Instructions for setting up username.github.com and stuffs. For eg : Lets take an example https://github.com/harikt/docs/blob/gh-pages/api/Aura.Di/_src.html is the source It should render at http://harikt.github.com/docs/api/_src.html But currently its not. It only happens for the names starting with _ ( underscore ). Let me know if anyone have the same issue or can it be resolved without renaming it ?
Names starting with underscore shows errors Page doesnot exists for gh-pages branch
Exactly, this is used to un-ignore a path that is ignored before that line. Your example illustrates the use case pretty good. You are ignoring everything inside media except xmlconnect.
I don't quite understand this I've read the official documentation on it from https://git-scm.com/docs/gitignore An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, "!important!.txt". I have this gitignore file /media/* !/media/xmlconnect What does this do exactly? I'm ignoring all subdirectories inside /media/, but am I making an exception to /media/xmlconnect (e.g. I'm NOT gitignoring it?) so basically I'm gitignoring everything but media/xmlconnect?
what does "!" do in gitignore files?
In BitBucket, an URL should end with #lines-x:y Example: https://bitbucket.org/stangenberg/docker-docker/src/1ac537b84855db2cc5ee0caf31c782900e094d8e/docker.sh#lines-13:15 Regarding Stash (now 2019+ renamed BitBucket Server), Stash 3.8 in 2015 is supposed to support deep linking with multiline selection. Issue BSERV-2477 With just shift+click, a developer can select a range of lines, then add separate lines to the selection with command+click (or control+click), then copy the URL and share their selection with other developers. The OP confirms in the comments: The stash url generated has #13-15 at the end, i.e. it is of the form: https://bitbucket.org/stangenberg/docker-docker/src/1ac537b84855db2cc5ee0caf31c782900e094d8e/docker.sh#13-15 As cellepo notes in the comments: this cannot be done in a pull request/code-review page (https://bitbucket.../pull-requests/...), but it CAN be done on a source page (https://bitbucket.../src/...) like in the aforementioned example URL.
With github we can use URLs of the form www.github.com/username/repo/filename.c#L20-L45 Note the #L20-L45 at the end which highlights the 20th to 45th lines of code when the page loads in the browser. This convention doesn't appear to work the same way in stash / bitbucket - is it possible to link to certain lines of code somehow?
Link to specific line(s) of code in stash / bitbucket?
You can use a tag to set a version number. You can read about the tag command on the git tag man page. At work I setup our build server to automatically increment a build version number which is then applied using a tag. I think this will meet your needs?
I'm using Github, and realized they have a nice little api for accessing repo information like commits, who did it, etc. This would be a great way to show previous versions of the project on an external site, but I was wondering if there is a known way to add a Version Number to the master commit? So the version number would either automatically increase with each master commit or I can manually set it. I know I can add it in the notes, but I'm not familiar if there is a way to separate it.
Is it possible to add a version number using git / github
Git usually guesses correctly whether a blob contains text or binary data by examining the beginning of the contents. In your case, however, git is getting confused and treating the file as binary, possibly due to binary data somewhere in the file. From the git-diff manpage: -a, --text Treat all files as text. So you can still get the text diff quite easily as follows: git diff -a WebRole/Sql/Objects/dbo.Content.Table.sql To override git incorrect guess add the following to .gitattributes in the same directory as the file: *.sql diff and commit this file. This will force git to treat every .sql file as text from now on, wether or not it contains binary data.
I have tried adding this to the .gitattributes: * text=auto *.sql diff But it still shows like this: BIN  WebRole/Sql/Objects/dbo.Content.Table.sql → WebRole/Sql/dbo.Content.Table.sql Binary file not shown Would appreciate help with this.
How can I make Git show changes to my .sql files?
I am actually doing workflow testing all the name, as you can see this test workflow workflow-level-notification is not merged into master branch (ie default branch), and I can still see the workflows in the UI. Like GuiFalourd said, you can also use act to do the local testing as well. But working directly in the github repo is not that bad. (you can delete the workflow after)
I am creating a new git workflow. And just like any other piece of code, I want to test it separately without having to merge it into master first. This will also help if I have to make few corrections if something doesn't work in the workflow yaml. Here is the mechanism that I am looking for: main branch has .github folder which contains all workflows I create a branch and add my workflow to .github folder Now I should be able to see(somewhere on Github) workflows from my branch running When I know that workflows are working fine, I merge my branch in master Now under github 'Action' tab, new workflows will reflect Is there a way to do this?
How to test github workflow without merging into master/main branch
What local branch have you checked out? What git status shows? You are probably working on some other branch than the local master branch. If you want to fetch new commits from github and merge them to the local master branch, you have to: git checkout master git pull If you want those commits in the branch, on which you are working, you need: git pull origin master You were close in your try from PS, but the last param should be branch name, not the repo url. You can also just fetch new commits from github, and do not merge it into any local branch, with: git fetch origin Then review those changes with git diff, git log, etc, and merge later to the currently checked out branch with: git merge origin/master
I'm trying to update my webbynode pulling from github but I got the message below: You asked to pull from the remote '[email protected]:sigbackup/gsapp.git', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line. So I have checked out this forum for help and I found some comments regarding .git/config file but mine looks already fine (at least to me): [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = [email protected]:sigbackup/gsapp.git [branch "master"] remote = origin merge = refs/heads/master [branch "origin"] remote = origin merge = refs/heads/master Am I missing something? Any ideas how I can solve it? PS I also tried git pull origin [email protected]:sigbackup/gsapp.git and I got fatal: Couldn't find remote ref [email protected]
specifying git branch for remote
Sure do the following: Remove the 3rd-party-folder which you might have added already Open your Terminal and execute the following commands cd /path/to/your/main/repo git submodule add [email protected]:someuser/somerepo.git somerepo git commit -m "Added submodules" Now instead of copying those files you'll have a reference to the other repository in your project: Edit: Now if you want to update the submodule to a more recent commit you can do the following: cd somerepo git pull # You can also checkout a branch / tag etc. cd .. git add somerepo git commit -m "Telling the main repo to update the reference to the referenced repo"
I've a Xcode project which itself has Git Source Control. In a Libraries folder I've cloned eight other Git project from GitHub. They are located inside my own Git repository and I've added all these libraries to my git in a commit. Instead of having the code of all these git libraries in my repository, is there a way to let git download their code from their repo when I make a clone of my repo? Or is it normal to include other git repos inside a project?
Git: How to handle git libraries in project
The images in the table have all the same dimension. The "problem" is that to every image a border is added. The border is white on even rows, and it is light gray on odd rows. The images in the even rows seem to not have a border because the background and the border are both white. (thanks to Shawna of the github support team)
I'm having some problems formatting a README on github. This is the raw README: | Italic | Block letters | :-------------------------:|:-------------------------: ![](outputs/output_Biotouch/18-15_02-02-2018/Identification/ITALIC/ITALIC_movementPoints_cmc.png) | ![](outputs/output_Biotouch/18-15_02-02-2018/Identification/BLOCK_LETTERS/BLOCK_LETTERS_movementPoints_cmc.png) ![](outputs/output_Biotouch/18-15_02-02-2018/Verification/ITALIC/ITALIC_movementPoints_notbalanced_roc.png) | ![](outputs/output_Biotouch/18-15_02-02-2018/Verification/BLOCK_LETTERS/BLOCK_LETTERS_movementPoints_notbalanced_roc.png) ![](outputs/output_Biotouch/18-15_02-02-2018/Verification/ITALIC/ITALIC_movementPoints_notbalanced_frrVSfpr.png) | ![](outputs/output_Biotouch/18-15_02-02-2018/Verification/BLOCK_LETTERS/BLOCK_LETTERS_movementPoints_notbalanced_frrVSfpr.png) It is just a table with relative references to some images. The referenced images have all the same dimensions. This is what comes out: Why are the images contained in the central row smaller?
Images in a table with GitHub markdown