Creating a new branch using Github Mac Application - macos

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.

Related

Unable to get changes that are in git repo into TFS with git-tfs

We use TFS for our source control system, but need to work with a contractor. We've set up a GitHub repo and I've been using git-tfs to move changes between the two. I'm not very familiar with git, and have managed to get myself into some trouble.
The git repo was in sync with the TFS repo. The contractor pushed a few commits to GitHub. After that, I checked in a few changes to TFS, then performed a git-tfs pull followed by syncing with GitHub (through the GitHub for Window application).
The changes I recently checked into TFS are in the GitHub repo. The changes from the contractor are in the GitHub repo and in my local repo, and I'm trying to get them into TFS. When I run git-tfs checkintool, I get:
Working with tfs remote: default
Basing from parent 'default:11102', use -i to override
Nothing to checkin!
If I run git-tfs rcheckin, I get the following. This shows the changes I'm trying to get into TFS, but notice the message at the bottom The item $/RDi/Software/System/SZ-Working3/EmbeddedGui is not a branch of $/RDi/Software/System/SZ-Working3/EmbeddedGui.. I think this is the problem, but I'm not sure how to rectify it.
Working with tfs remote: default
Basing from parent 'default:11102', use -i to override
Fetching changes from TFS to minimize possibility of late conflict...
Working on the merge commit: d2a85cd7b88715cabc6ed6cf5b9b7b5fc60359e0
Starting checkin of d2a85cd7 'Merge commit 'd36d26a6c6af5c1e89cf4dc7b2634964827b3ded'
Updated port screen PSD files. Should have what contractor needs regarding the animated arrows.
Replace language PSD files with new ones - the new ones contain the button pressed state for the OK/Cancel buttons.
Remove test file.
swiping removed from language page
Worked on issue 25: RemoteLib locks up when network settings update.
yes/no button added on language page'
edit .git\~w\QtJson/JObject.h
edit .git\~w\qml.qrc
add rsrc/images/480x272/common/no-small.png
add rsrc/images/480x272/common/yes-small.png
add rsrc/images/800x480/common/no-small.png
add rsrc/images/800x480/common/yes-small.png
edit .git\~w\rsrc/qml/pages/MetricsPage.qml
edit .git\~w\rsrc/qml/pages/RegionalSettingsEditorPage.qml
The item $/RDi/Software/System/SZ-Working3/EmbeddedGui is not a branch of $/RDi/Software/System/SZ-Working3/EmbeddedGui.
The item $/RDi/Software/System/SZ-Working3/EmbeddedGui is not a branch of $/RDi/Software/System/SZ-Working3/EmbeddedGui.

Commits pushed to Github through Github Desktop App(Windows) not showing up

I created two repositories through the Github website about a couple of hours ago. Then I went to the Github Desktop App, and made many commits to each of those two repositories. The process I had followed was:
Create repository on Github website
Go to Github Desktop App, and hit "clone" for the selected repository
The repository was cloned to a "Github" folder in "Documents"
Then I copied over my code files to each of the repository folders (through Windows explorer)
In the Github Desktop App, I automatically got the "x uncommited changes" for the number of files I had copied over.
I added a message in the "summary" and "description" section, and clicked on the "Commit" button at the end, and a blue check mark appeared.
However, now that I'm on another (ubuntu) computer and wanted to clone the 2 repositories on this, it appears that none of my commits were ever pushed to Github. The Github website also just shows the 2 repositores I had created at the very beginning, intialized with a readme.md. There's nothing else.
What went wrong?
Create repository on Github website
Go to Github Desktop App, and hit "clone" for the selected repository
You should copy all your files to cloned repository.
Click to view all uncommited changes.
You have to write the summary and description and hit the button 'commit to "your branch name"'.
And as a final step, you should push 'Sync button' at the upper right corner.

Pushing Images to Git Repo from Xcode

So this problem already helped me solve another one of our issues, but I still haven't figured this one out. (This is relevant. Hold on.)
I am developing a game with one other person. Neither of us have ever used git repositories, Github (for more than reference) or any sort of version control before, and we've had some trouble getting set up.
We have our project set up in Xcode with remotes to a GitHub repo, and everything is working fine with the code. The problem is that we can't get our images (buttons, backgrounds, animations etc.) to commit to our local repo without resorting to one of two, very roundabout, methods.
Right click on our Assets group in Xcode and select Add Files to Project. I have to do this every time we add images anyway. Then, to get Xcode to realize that these are files that need to be added to the repo (at least to get the A indicator next to the files in the organizer) we have to go in and add a blank Objective-C class, then right click the images > Source Control > Add. Then delete the blank class.
Use the GitHub app to commit the project and push it from there. This isn't working because Github's .gitignore doesn't include the xcode preference files. This makes the project unable to commit from Xcode on any other machine, and even from the machine the commit was made from after a reboot. (This is the problem we figured out trying to commit images.)
So my question is: How do we share assets for the game? I figure that Xcode will do the same for sounds, we just haven't gotten there yet. Is there an easier way to get Xcode to recognize them? Or do we just need to add those user profile files to the .gitignore on GitHub? (And how do we do this?)
Every one using Git just has to watch these two videos:
Git For Ages 4 And Up
http://www.youtube.com/watch?v=1ffBJ4sVUb4
Advanced Git
http://vimeo.com/49444883
1) I've found the best way to add images to my Xcode project is to just create the directory structure I want in the Finder then just drag and drop them from my finder in to the proper group in Xcode Project Navigator. Multi select all the new files, right click (control-click on a laptop) and select Source Control -> Add
And Bobs your uncle!
2) I do not use the GitHub app, I use SourceTree and the GitHub website. I've 20 years experience with command line source control systems but Xcode and SourceTree are so good the command line is no longer a part of my daily workflow.
I create a new Xcode project and check Create local git repository for this project then I go to the GitHub create a new repository with the same name as my project's top level directory. Copy the GitHub url. Drag the new project directory into SourceTree's Bookmarks window. Double Click on the new project view in SourceTree. Right mouse click on REMOTES and paste the GitHub url and enter origin/master for the name. Click the big push toolbar button.
3) You need to add your user scheme and workspace file to .gitignore to push and pull from a remote you have to have a clean working repo. This is super simple with SourceTree just commit in Xcode and then open the project in SourceTree right click on the WorkspaceSettings.xcsettings and *.xccheme file and select Ignore... and it creates the .gitignore file for you. Now commit the .gitignore file and Push to the remote.
FYI: Check out SourceTree (http://www.sourcetreeapp.com) is's free in the Mac App Store. It's a very good GUI for Git. Atlassian makers of Jira acquired it and the original developer and released free to compliment the rest of there tools.

GitHub (Mac application) - commits not visible

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?

Add Xcode project to github repo?

I have JUST created a new github repo on the website. Keep in mind that I am a noob but can do basic things in terminal. Anyway, so I just created the repo on my account on github.com and didn't do a single thing to it yet.
So all I want to do is take my Xcode project folder and upload it to my new github repo. How do I do this via terminal?
The best way really is to follow the instructions GitHub gives you:
First, go the correct directory
cd <directory of your Xcode project>
It sound like you've already got a local Git project from Xcode. If that's true, skip this code block.
git init .
git add .
git commit -s
<type in a commit message>
Last, push into your repository. The following is copied directly from my own github account, after I created a new "test" repo. Change the "dhalperi/test" part.
Push an existing repository from the command line
git remote add origin git#github.com:dhalperi/test.git
git push -u origin master
I was just going to leave a comment above but I will also add a summarized answer. My full answer is here.
This isn't via terminal as the question requests, but you can consider this an alternate method. It is well integrated with Xcode now, though, and not difficult to do.
Create Git repository when making a new project
See the answer I linked to above if you already have a project without a Git repository.
Make a Commit
After making a change in your project, select Commit... from the Source Control menu. You will add a short commit message.
Create a new GitHub repository
On the GitHub website make a new repository. Call it whatever you want, but don't add a README or .gitignore or license yet. After creating the new repository copy the link to it.
Add a Remote in Xcode
in Xcode go to Source Control > your branch name > Configure. Then click the Remote tab > "+" button > Add remote. Fill in your repository name and address.
Push your project to GitHub
Go to Source Control > Push. You will have to enter your GitHub user name and password the first time.
That's it. Now any time you make changes in Xcode, all you have to do is Commit and Push.
If you didn't follow this explanation, please read this and this for more detail.
Further Study
This is an excellent video that I recently watched that helped me understand Git and its integration with GitHub much better.
The Basics of Git and GitHub
An easier way to do it in Xcode.
You can even push only one current branch to GitHub or the whole project.
(for Xcode 11)
Just select a needed branch/(or top folder) in "Source control navigator" and right-click on it. Then select "Create remote". Or "Editor -> Create remote".
Then use your account at GitHub to create the repository. If using your GitHub account is not proposed maybe you still not add your GitHub account in Xcode -> Preferences -> Accounts
After everything is set up. Click "Create".
To push your project/branch to GitHub repository click "Source Control -> Push".
After that check Github. All should be there.
Get the Github Mac Application, you don't really need a terminal unless you want to do more fancy advanced stuff ;-)
Simply go to your project page on GitHub, then click on "Clone in Mac", this should automatically download and install it for you. You have to do this at least once to install the app and setup some required permissions.
After that, you'll see the GitHub Application in your Dock, simply open it, then click on that small "+" sign at the bottom, there you'll see "Create New Repository" and "Add New Local Repository".
You can either add the repository that XCode already created for you or download one from GitHub, then open it in XCode.
if you already have a git repo on your Mac and using Xcode 9,
for xcode 9, just go to the source control tab in the navigation inspector in Xcode. right click on the master git and select create "Your project name" remote on GitHub.
give your GitHub credentials and give a name to git repo and Xcode will create and push your code for you.
a non terminal solution is to install SourceTree. Its a GUI thats super easy to use compared to the terminal. But its highly recommended to learn git commands properly.

Resources