How to clone Github repository to local device with Github Desktop - xcode

I have a project my friend and I are working on. He made some changes and added them to the project on github. I hit clone on the project in github and then it opened up the github desktop and now I have 1 arrow pointing up and 16 pointing down.
I believe this means I have a non-committed change and 16 changes ready to be pulled, but no idea how to find this change, or if I commit the change will it take away all the changes already on github that are not on local yet?
Just don't want everything to just be deleted. Thanks.

I have a non-committed change and 16 changes ready to be pulled, but no idea how to find this change,
Committed change actually: you have one local commit.
You can:
do a backup of your local repository
make sure you have autostash and rebase in place
then pull through the GitHub Desktop interface.
That is (Git 2.9+):
git config --global pull.rebase true
git config --global rebase.autoStash true

Related

git - Switching to a local develop, then back to feature branch resets the status of modified/added files

I added some changes in my feature branch, staged, committed and pushed it to origin using push -u git command.
Next day, I updated my local develop and feature branches to get latest code from remote using standard git fetch / git merge procedures.
At this point, I am seeing some interesting things:
I am on my feature branch, git status tells me all is clean, this is correct
I switch to develop branch, git status shows all is clean, this is correct
I switch back to my feature branch, git status reports all my changes that I already pushed to remote day before as follows:
STAGED (GREEN) - My changed are being removed (which marks some files as being ready to commit). The existing files are marked as modified and my changes are removed from them. The files I added are marked as deleted,
NOT STAGED (PURPLE) - The existing project files I modified as part of my push,
UNTRACKED (RED) - The new files I added to the project as part of my push above.
I dont understand why is this happening but it should not.
If I issue git add ., no message shows in git, I am just back to the terminal command.
If I issue now git status, it now shows that my feature branch is uptodate "nothing to commit, working tree is clean".
Switching back and forth from feature to develop and develop to feature branches like described above on my Mac reproduces same problem over and over. Doing so on my Windows machine is not reproducing this issue at all.
So, my conclusion is that something is wrong with my git environment on my Mac machine.
But then, I also tried getting a brand new clone of my project on my Mac (which now contains my feature branch since I pushed it with all my changes using git push -u command), then tried switching back and forth on that clone between develop and my feature branch and the issue was NOT happening. That made it even more confusing.
It looks like something is not being updated properly with my git on my Mac machine. What could it be and how to investigate this?
We are crossplatform team working on both Mac and Windows. My core.autocrlf is set to input on my Mac and to true on my Windows. I dont know other team members settings for core.autocrlf.
First, make sure git config core.autocrlf is always set to false (on Windows or Mac).
Any EOL conversion you might need should be done in a .gitattributes eol attribute.
Then check your git config -l in your repo on the two platform: a content filter driver could be an example of automatic modification on commit, which might not be declared on the other platform.

How to upload xcode project into bitbucket from scratch?

I am not able to upload project from Xcode to bitbucket. I have committed but it is not updating.
When you commit your changes in git they are only tracked on your local machine. This means that your local copy is versioned (and you could revert back to a previous version if needed)
If you want others to see your changes, you need to push those changes.
i.e. git push
This sends your commits to a common 'server' where others can retrieve them by performing a pull.
A really good set of tutorials for Git was put together by the folks at Atlassian: https://www.atlassian.com/git/tutorials/
In short, update your local copy before pushing your changes
git pull
Then push your changes:
git push

Change Git Repository Of Existing Xcode Project

I cloned an abandoned repository from Github, and now I want to be able to upload my changes to a private repo so that a few other people can work on the changes with me. Unfortunately, since I cloned it instead of making a fork, so Xcode is trying to make the commits to the original repo. Is there a way to change what repo the commits are being made to? If there is, would there be a way to change it to a repo on another website (Bit Bucket)?
I fully intend to make the repo public once the changes are complete.
You can do it through UI
Select Source Control Navigator from the left pane
There you can find your current remote repo under the Remotes Folder,
then delete the existing repo:
Now You can add Your Existing Remote
Enter Remote URL
As mentioned in "Git XCode - change origin", you simply can change the remote origin url, using git remote set-url (or in your case, rename+add).
git remote rename origin upstream
git remote add origin /url/of/private/repo
(with the XCode GUI, you could remove, then add again, the remote origin)
If that private repo is empty, you can push to the full history of your cloned repo.
By renaming 'origin' to 'upstream', you keep the possibility to fetch from the original repo, while pushing to your new origin target repo.

How do I update the /app folder when Laravel is updated?

Sometimes I have problems with my Laravel project after running composer update. I believe this is caused by changes in the Laravel application skeleton (https://github.com/laravel/laravel). How do I update my local project to reflect those changes?
From the awesome forum post on the Laravel forums by Kindari (http://forums.laravel.io/viewtopic.php?id=5367):
If you originally cloned this repository and still share a git history
with it, you can usually merge in changes easily. Assuming your remote
is 'upstream' pointed at this repository, you can do the following:
git fetch upstream
git merge upstream/develop
Alternatively you could cherry pick in individual commits
from the develop branch, but I won't cover that here.
If you downloaded the zip distribution originally or
removed the upstream history, you can still resolve your problem
manually. Look at the commits on this branch and make any changes not
present in your application. Usually the breaking changes are simple
configuration changes.
Since most of the changes are likely to be simple configuration changes,
another option is to do a diff on the root folder and the /app folder. You'll mostly see your own configuration, but you'll also see any new configuration items that you should add.
I usually use git pull request. A git pull request does a git fetch followed by a git merge. It works for me nicely. In other words, A git pull is what you would do to bring your repository up to date with a remote repository.

Updating from a clone repo to the original repo on my server

I'm sure there's something very simple I'm doing wrong here, so I made these diagrams in the hope that someone can figure it out for me. Basically, I cannot get any new files from my cloned repo to show up on the original repo on the server.
Currently, I have a magento installation on my production server. I made this a --bare --shared git repository then cloned it to my local mac git.
I understand how to stage and commit within the clone repository, but I assume this is all local, the commits are contained within the mac's repository and don't actually touch the server.
This is where something is going wrong, now that I have my local repo in the state I want it, do I push it to the original repo?
Then, I assume I will stage and commit the changes on the server?
Last, I realize this is a very basic workflow, but I'd like to master this layout for now before I make things more complex.
Thank you.
After you have stage and committed in your local repo, you have to push to the server:
git push origin master
where origin is the remote you are pushing to ( automatically setup when you clone) and master is the branch you are pushing.
Note that you push commits and not files. So once you have pushed, you are done. You don't have to stage and commit on the server.

Resources