Visual Studio 2015 Community: Commit to github via command line produces inaccessible file...? - github

I create a new repo on Github and follow the instructions.
Then I open Command Prompt and follow Github's instructions.
The picture is what I get...what appears to be file containing my project that is inaccessible.
What am I doing wrong?

This is not an "inaccessible file", but a nested git repo.
It is recorded in the main git repo (published on GitHub) as a gitlink, a special entry in the index, and is displayed as a gray icon.
If you really want its content, you should transform it as a submodule.
As such, that gitlink points to nothing, as there is no way to know the remote url of that repo (only its SHA1 which is what the gitlink records)

Related

Change Line Ending on File in GitHub Repo

GitHub supports Adding a file to a repository. How can the line endings be changed on an existing file in the repo with the GitHub gui?
This is for an existing file in repo without cloning repo and changing it in git.
The GitHub documentation about "Configuring Git to handle line endings" only mentions a local Git setting.
That being said, if you can open your project in a GitHub Web IDE (or a github.dev web-based editor), then you could change the EOL of a file.
However... that would be still cloning the repository (on an Azure VM generated for github.dev/github/dev to use).

How to create a new file in github and add there existing files?

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/

How to transfer Github Gist to Repository?

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.

How do I get my site to show up through github?

I uploaded my files to github, checked off readme, commit changes, selected masterbranch, and I got the following message as I scrolled down the page: Your site is published at https://tanishav842.github.io/Recipes/ but there is nothing there except for the word Recipes, which appears at the end of the site address that had been established for me through github. What did I do wrong?
Well, Tani, to have your own page hosted by GitHub Pages it need to be stored in one of the following places
In a public repository named <your-github-username>.github.io
Under a docs folder in master branch of any public repository you own
In gh-pages branch of any public repository you own
It means your Recipes repository are pretty much there.
Just copy your master branch content to a new branch named gh-pages and push it:
git checkout -b gh-pages
git push -u origin gh-pages
In addiction, as commented Edric, it would be cool to have your pretty nice stuff added to your page.
By now, I suppose GitHub is using your README.md that just have the word Recipes there!
Anyways, Here you can find a bunch of details about Working with GitHub Pages and also some step-by-step tutorials to learn how to do it properly
Hope this can help you!
Hosting a site is better supported by the GitHub application. Try following these steps to see if they help:
Download either GitHub for Mac or GitHub for Windows, depending on your operating system. Open the app and log in using the account you just created.
(On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.
Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, enter a message in the text box called "commit summary", something like "initial commit." Then, click the commit button.
Click the "Publish repo" button in the top right corner.
Give it about 10 minutes, then check your-username.github.io. Your website should be there!
Here's the reference link:
https://gist.github.com/TylerFisher/6127328

Visual Studio 2015 with github plugin issue

I'm new to using github with visual studio 2015 plugin and I'm stuck.
I created a new project on github and was able to link the depot to my visual studio project. I was able to sync some code up to the depot.
Then I added a readme file to my project on github from the website. Next day I made more code and decided to sync it up to the depot, but now it says that I have incoming commits (the readme file). I clicked on fetch on the incoming commit but nothing happens. I clicked on pull and it says my changes would be overwritten by merge.
I then went to outgoing commit (the ones i just made) and click on push. it says that "You cannot push branch master to remote origin because there are new commits in the remote repository’s branch. Pushing this branch would result in a non-fast-forward update on the branch in the remote repository"
i click on several things and i still can't resolve this issue. I want to update my current project with the readme and then update my depot. (i also am new to the terminology)
The trouble is that you've got changes on the server, that are committed, and changes to some of the same files on your local copy that conflict with it to the extent that Git can't figure out which ones should "win".
You'll have to look at each file that has conflicts, understand where the conflicts are, sort them out, tell git that you've sorted out the file, and then progress.
So Fetch will bring all of the changes down from github, locally, but not change your working copy.
Merge is intended to pull down the changes in your current branch and merge them in (and that's where it's having trouble).
Best recommendation for working with git (whether Visual Studio or not)): Fetch and merge often. Every day at least.
This page looks like a reasonable tutorial on how to do it. It looks similar to my VS2015 git plugins.
https://msdn.microsoft.com/en-us/library/dd286559.aspx
This page is quite a good tutorial on doing it from the command line:
https://easyengine.io/tutorials/git/git-resolve-merge-conflicts/
(But I've got to say: the Visual Studio tool makes it easier).
So the key points are:
look at each file and fix the conflicts.
tell git that you've fixed the file
Once you've done all the files, you need to "commit the merge"
Then you're in a place to commit your local changes and push them up to the server.
Second tip: Most people that I know who use git with visual studio also use the command line client extensively, and usually have an additional gui client (such as Atlassian's Sourcetree) as well. I use all three every day.