I am new to Github. I recently have created a gist https://gist.github.com/8d11e24576c94b2c07a9a48288082588.git and want to transfer it to my repository at https://github.com/Muhammad-Ammar-Masood/Log-In-Page.git.
The simpler approach would be to clone your repository, and copy in it your gist, as a new file.
From there, add, commit and push.
Note that you can, from command-line, list your gists with gh girst list and view the content of a particular gist with gh gist view
gh gist view https://gist.github.com/8d11e24576c94b2c07a9a48288082588.git
(you need to install gh first)
You can also, since yesterday, do it online by going to your repository Muhammad-Ammar-Masood/Log-In-Page, and use GitHub Codespace by typing ..
You can add your gist in the online VSCode there.
You can, download Github Desktop on "https://desktop.github.com/", log in , create a new repository with GitHub Desktop, then choose a local directory on your PC for the newly created repository.
You can go to your Gist and choose to download as zip at the right end of the options
Screenshot of Gist Url and the download button highlighted
You can extract the zip file to your local directory assigned for the newly created repository.
On your GitHub Desktop : You can commit and push the changes of the repository to your GitHub.
Related
I have files in repository. I want them to be grouped inside a folder. How can I do this?
It seems that I need to add new file if I want to create a folder.
From how you worded your question, it seems like you're trying to work on github directly from the website.
The usual way github works is:
if you have a repo on github and you want to modify it, first 'clone' the repo into your local computer,
use these instructions https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
then just change folder structure like you would normally on File Explorer (windows) or Finder (mac),
then follow the commit instructions and 'push' up your changes to github
use these instructions
check status of your recent changes:
git status
add the files that you want to include in the commit
git add nameOfFile
check status and the file you want to include should now be green
git status
use this to send to github
git push
Overall github docs here:
https://learn.microsoft.com/en-us/training/modules/introduction-to-github/
We have to create repository and upload the data from one application to github , with out storing any data in application system ... It is possible
How is the data currently stored? You could .gitignore the files you don't wish to push if saved within your directory, and follow these directions to store your code in the repo from the GitHub command line.
https://docs.github.com/en/github/importing-your-projects-to-github/importing-source-code-to-github/adding-an-existing-project-to-github-using-the-command-line
You could alternatively create the repo in GitHub and link it to your local repo:
https://docs.github.com/en/github/importing-your-projects-to-github/importing-source-code-to-github/importing-a-git-repository-using-the-command-line
I have multiple repositories under my account, and I placed a folder into the incorrect repo.
Is there a way use the GitHub web interface to move that folder from one repo to another?
From GitHub GUI alone, I don't think so.
You can delete files from the web GUI, but you still need to push your folder content from a local cloned repo (the right one this time)
Note: even if GitHub GUI referred to GitHub Desktop, you would still need to push.
I have a Jekyll blog that I have hosted on GitHub Pages. What I am trying to do is update the existing repo with my new files. I wasn't sure what to do because I didn't want to delete the repo, and I didn't want duplicate files (old and new), just my new files from my new directory.
My question is (giving another breakdown first)-
I have deleted the old directory locally that included my hosted GitHub Pages Jekyll blog files.
I re-made a new Jekyll blog locally under the same name as my previous directory (using *jekyll new username.github.io *)
I still have my old blog files in my jekyll blog repo on GitHub.
I would like to delete the old files (but not the repo), and update that repo with my new blog files. How would I go about doing that?
Assuming it's a normal git repo, you should be able to link it with the upstream repo in the usual way (further details to come in an edit).
Jekyll/Github docs: https://help.github.com/articles/using-jekyll-with-pages
You should be able to run git push from your new repo, and it should just work. If not, hopefully a git pull beforehand should solve it. If not, post a comment and I'll see if I can help.
I've seen the command needed to remove a file and erase it from the history on git. Is there a way to do this with the github website? If not, it looks like I need to know where the file is to do it with a git command. Where does github store the local repositories?
See: https://help.github.com/articles/remove-sensitive-data
To get a local version of the repository, look up the URL from the repo page on Github and clone as explained in the link above.