GitHub (Mac application) - commits not visible - macos

I have just recently installed the github mac application and attempted to push some existing commits to a branch using the Synchronise button. I am authenticated with SSH keys, the application did not complain and it seemed to work. However, when inspecting the remote repository on github.com I cannot seem to find my commits anywhere, not in the history of the branch or individual files. It's as if I had committed nothing.
However, inside the GitHub app i can click on the "view on github" button and it will inspect the commits and show the diffs etc. correctly as if i had navigated to them on the website.
Does anybody know why this may be happening? Apologies in advance if this is a trivial problem!
Thanks

I'm not sure if I understand your question right, but did you first commit and then use the sync button?

Related

What happens when I "save" in Xcode IDE

I'm just starting to learn Swift using the Apple Xcode IDE. I made a little test iOS app and was trying various things when I inadvertently deleted my main code file (ViewController.swift). "No problem", I thought, as I had hit "Save" just a couple of minutes before. I exited out, then came back in, but it appeared to have autosaved.
I don't really care about this test file, but am wondering what is the proper way to save a project before trying something out (or before inadvertently pulling a bonehead move)?
What happens when I “save” in Xcode IDE?
When you hit "Save" the changes you've made are saved to disk. XCode doesn't do this automatically. If it crashes you may lose all your code written after the last time it was saved to disk. But XCode saves the changes to disk even without hitting "Save" button in some cases.
Xcode automatically saves changes to source, project, and workspace
files as you work. This feature requires no configuration, because
Xcode continuously tracks your changes and saves them in memory. Xcode
then writes these changes to disk whenever you:
Build and run your app
Commit files to a source code repository
Close the project
Quit Xcode
https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/UsingFileSaving.html
Use Git. If you don't know what it is, look into it. In the mean time, here is a tutorial or two.
To use it in Xcode, when you create a project, be sure to create a git repo:
Then be sure to commit frequently. Xcode has a built in Git GUI, so that makes it easier:
Then if you do anything that you shouldn't have you can either discard all changes (see the above screen shot, or if that can't help you, you can:
Open the 'Terminal' app
cd to the directory with the project
Run git log
Find the commit before you ruined everything
Copy the commit hash
Type q to exit the log
Run git reset --hard <THE-HASH-YOU-COPIED>
That should do it for you.
When creating a project check 'create git repository on my mac'.
Then commit changes when you're finished with one minor part and give the commit a comment so you know when looking into the history what changes you have done (quick overview).
With git you can quickly revert changes and go back to certain revisions like you can do in TimeMachine.
Further information are available at git's webpage.

cloud9-ide: how to delete workspace?

Is there ability to delete the workspace from cloud9 ?
and also don't see (in IDE) to commit the changes into git (bitbucket) , because of project was initially imported from there
Please check out Cloud9 Documentation about workspace deletion.
Regarding git, you can use the Cloud9 workspace's Terminal to run any git command. We also have an experimental Git UI in the works. Please note that it is still in beta. You can enable it by going to Preferences (Cloud9 > Preferences). Click on 'Experimental' and then enable 'Changes Panel'.
Once enabled, you might have to refresh the page once. Then look at the far right of the IDE where the tabs for 'Workspace', 'Navigate' etc are. The last one should be 'Changes'. Click on that to view the changes panel. You can use that to view diffs on your files, make commits, push and pull to and from your remote repo.

Creating a new branch using Github Mac Application

When I create a new branch using the Github Mac App, that branch does not show up on the Github website. Also the other way around is the same, when I create a new branch using the website, that branch does not show up on the app. Can anyone tell me why this is?
edit: I believe it is because nothing had been committed.
You have to push the local branch to your repo to have it appear on Github.com. You can do this by clicking the Publish button next to the branch on the Branches view, or the Publish Branch button in the window's title bar.
You have to pull the remote branch from Github.com to have it appear locally. I believe the only way to do that from the Github for Mac client is to use the Sync button.

How to ignore uncommited change in Github gui for MAC?

I am using Github GUI for Mac.
Now I've some changes in my local repository, but I want to ignore them and pull latest remote repository.
I tried Repository/Pull, but got Git Error.
"•error: Your local changes to the following files would be overwritten by merge:
Classes/xxx.m
Please, commit your changes or stash them before you can merge."
I tried Repository/Synchronize, but got following error.
"Sync Failed. Please commit all your changes before syncing."
Any idea?
Place a checkmark near each of the changed files, then go to the Repository menu and click Discard Changes to Selected Files.
If you mean using MAC GUI only, check and right click the changed files then select the discard the changes.
if you want to remove your uncommitted changes, just do a checkout on those files again.
Stash is super easy too though, and it keeps your changes in a local 'bucket' or stash :)
For those on Github for Windows, it is not obvious where Discard All Changes is, so I wanted to share this:
Select Files by using check mark next to names.
Right click on Collapse All/ Expand All button with two arrows. (This button is on right side of Files to Commit box, and under Sync and Gear icons.) This is where Discard All Changes is >hidden<.
Sorry but too low level to add comment to #Leo wangs or #aspiringwebdev chain above. You gotta start somewhere...

Where is the repository picker in my Git GUI?

I have just started using GIT and for some reason every single time I click to open GIT GUI I can't see the repo picker, it just goes to the repository screen and shows it's in C drive.
Does anyone know how to over ride this so I can pick my repo every time it opens like normally?
Thanks
If you are talking about the git gui command, it opens a repository determined by your current working directory. If you are outside a GIT_WORK_TREE, then you will see a dialog that allows you to select a repository.
If you're using some other tool, you will need to update your question to get a better answer.

Resources