Github.com repos created not showing on Github desktop - github

New to git and github. Not sure why the repos created on my github.com page do not show on the github desktop version. Aren'they supposed to be automatically synced?

In GitHub Desktop, select File > Clone repository, or use the shortcut Ctrl+Shift+O.
There, under the "GitHub.com" tab, you can see the list of all GitHub repositories that you have access to. You can click on the refresh icon to re-sync if any repository is not yet visible.

Related

Is it possible to show organisation repos in GitHub desktop without manually cloning through the app?

I wrote a script to clone many repositories from my organisation (The organisation is set as a business), but these repositories do not automatically show up in GitHub Desktop. It seems as though to make repositories show up in GitHub desktop I need to clone through GitHub desktop or add each repository manually through the local option.
Is there a way to make organisation repositories that I have cloned automatically show up on GitHub desktop?

Can't connect GitKraken standalone version with GitHub

There is no GitHub option in GitKraken. There is GitHub Enterprise, GitLab, Bitbucket, Azure, Jira but no GitHub option in the preferences. Anyone has had a similar problem?
If you click the "+" button in the top bar, you open a New Tab with many options. You can create a new repo hosted on GitHub, or close an existing repo hosted on GitHub

Github Desktop: Not able to publish

I have a project which I want to upload to GitHub. I have used Github Desktop to create a local repository and I am able to commit files to it. But once I try to publish it, the publish icon just fades and won't allow me to do it. I have checked my settings in Settings->Options and they are correct.
Since the local repo has no remote url, you need to add one, referencing a remote empty repo that you own (on GitHub for instance):
cd /path/to/repo
git remote add origin https://github.com/<user>/<an_empty_repo>
Or, in GitHub Desktop:
Settings->Repository settings->Remote
Then you will be able to publish.

Can't checkout remote branch using GitHub Desktop

When I first clone a repo using GitHub Desktop (windows version), I'm able to see all of the branches and can checkout the branches.
However, if another contributor creates a new remote branch (after I've done the clone), GitHub Desktop isn't able to fetch and checkout the new branches. The branches are visible via the GitHub website. The only way I've found to checkout these branches via GitHub desktop is to delete the local repo and clone again. I was expecting the "Sync" button to handle fetching new branches from the remote repo.
Any ideas?
According to Steve Ward at GitHub Support:
You should be able to hit F5 in GitHub Desktop to refresh the repository and fetch any new branches from the remote repository. There currently aren't any animations for this process, but it should work without issue. [...] we automatically fetch new branches every five minutes as well.
You can also click on the "Gear" button in upper right of the client, select "Open in Git Shell" and type the command git fetch in the command window that is opened...

How to push unsynced commits to GitHub?

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?
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:
You need to add the online GitHub repo as a remote in your local git repo.
On the command line, that's git remote add origin <urL>; I don't know if the VS git UI exposes this.
We use Atlassian Stash but also found the Visual Studio UI a bit confusing at first. The sequence that works for us, using only the UI, is as follows:
First you have to add your "username" and e-mail address in the Git global settings via Team Explorer > Home > Git > Git Settings
On the "Solution Explorer" tab, right click on the solution and "Add Solution to Source Control" and choose Git.
On the "Team Explorer" tab, click on the repo you just created and go to branches
Choose the master branch, right click on it and choose "Publish" - you will be asked for the remote URL whereupon after you enter it, you will get a username/password prompt (for the remote server i.e. GitHub, Stash, etc.)
All this is doing is git push origin masterbut Microsoft chose to make it confusing by giving it another name.
Wait for the "publish" to be completed (there will be a file transfer status shown in the UI)
Once it is completed, go to the commits tab and you will see that all the options for Push/Pull/Fetch etc are available
Note: If you create another branch locally, you will have to push, er "publish", that one as well before the remote knows about it.
Final note: Visual Studio will not create projects and repos for you on the remote. You have to make sure the repo is setup on the remote before you can push a branch to it.
Weird issue: We found that if you try to push to a branch but fail (due to incorrect URL or a permissions issue) that we had to go back to the command prompt to "fix" the remote configuration for the repo/branch. This is using the standard git command:
git remote add origin https://myuser#stash.mycompany.com/scm/myproject/myrepo.git
After you publish a branch as in #jamill's answer you may run into this.
In Team Explorer, I was able to publish a branch, but then I could not do anything. Pull and Push were grayed out as shown:
So I did Actions > Open Command Prompt. Then Type:
git push origin My_Branch_Name
After doing this I could see the branch and my commit in my remote. (Github or whatever in your case). Also when running the command, the output said,
remote: Create pull request for My_Branch_Name:
If you want to keep this branch and merge it into master, then you can create a pull request on your remote. Otherwise as in my case I want to abandon the branch. You don't have to do anything.