How can I fetch notes from a remote git repository with TortoiseGit? - tortoisegit

A typical use of notes is to supplement a commit message without changing the commit itself. Notes can be shown by git log along with the original commit message (Git-notes documentation). With TortoiseGit I can create a note by Edit notes context menu, and then push this note to a remote repository by the Sync -> Push notes command. The notes then appear in the remote repository as expected.
On the other side I didn't find any possibility to fetch notes, neither with clone, nor with fetch or pull command.
What is the usual way to make sure git notes appear in every cloned repository?
Edit: I'm using TortoiseGit 2.7.0.0 and Git 2.19.2.windows.1 on Windows 10.

Notes are implemented in Git as a "normal" branch.
Therefore, you can easily fetch, pull and push it using refs/notes/commits. Just enter refs/notes/commits as local and remote branch in the fetch/pull/push dialog.
cf. https://web.archive.org/web/20180121193320/http://git-scm.com/blog/2010/08/25/notes.html and https://stackoverflow.com/a/18269026/3906760.

Related

Can tortoisegit be configured to automatically merge and it that fails to produce a conflict file to use for merge

We have been using tortoise svn for quite a while and loved it.
When we did an update it would automatically merge and if there were conflicts
it would produce a conflict file and I could use the merge tool on it.
With tortoisegit, if someone has been in the file it does not even attempt to
merge just produces message similar to "Cant". Is this a problem with git or
tortoisegit. We used tortoisegit because of how easy tortoise svn was to use and did not get in the way. Whereas with tortoise git we get the "CANT" and many dialogs to
click on when we do anything.
How can I merge in tortoisegit if there is a conflict, and is there someway to tell
it to produce conflict files.
I will try to summarize how Git synchronization with remote repository works.
You Commit your changes into a local branch.
You want to Push your changes into remote repository. If Git finds out there are new changes in remote tracking branch, it will not allow the Push and will say "you have to do Pull first". (This is a restriction in the Git itself, not only in TortoiseGit.)
As per instructions you do Pull. New merge commit combining yours and others' changes has to be created. If there is no conflict, merge commit is created automatically. If there is a conflict, TortoiseGit force you to resolve it and Commit changes manually.
Finally, you do Push.
I think the main difference from SVN schema is the creation of merge commit, but I don't see this as a disadvantage at all.
A good way to avoid merge commits is to always do Pull before committing so you commit to the newest version of the branch. However if you have working tree changes in a file which needs to be updated during Pull, Git will say Your local changes to the following files would be overwritten by merge and Please commit your changes or stash them before you merge. In this case you should do Stash changes, repeat Pull and finally do Stash Pop.
You may call all these operations from TortoiseGit context menu or you may try to use Git Sync dialog.

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

Add Github remote to GitKraken

I'm using GitKraken (v. 1.4.1) as my Git managing tool. And now I want to use Github as a remote to back up my repos. But when I click on add remote and try to add a Github repo, it just says 'no match'
Does anybody know why this happens? (BTW: I'm using Windows 10, just in case that's relevant)
Here's how it seems to work. If you have a local repo and want to connect it to github, you would use the "URL" option and put in the github address to set that as the remote repo for your local repo. The first time you do a pull or push on a local branch, it will ask which remote branch you want to use and that becomes the remote location to which you will pushing and pulling changes.
The GitHub.com option only comes into play after you have set the remote repo using the "URL" option. If there are multiple collaborators on a project and someone has created one or more forks of the project, then instead of "No Match" under the GitHub.com, you would see a list of all the forks of the project on which you are a collaborator.
You could then add the forked repos as the 2nd, 3rd, etc. remotes, and any activity on those forks would be displayed to you on the commit graph. This allows people to see what's going on in the forks, and you can drag and drop from the forked parts of the graph to create pull requests to the repo you first set up using "URL".
It's a nice feature, but the remote dialog could be labelled more clearly so that people would know the GitHub.com option was for adding forked repos to the commit graph display.
You must always use the "URL" option to add the 1st remote, and then the GitHub.com option only becomes available after that if there are forks to which you have access.
If GitHub is set with your account in GitKraken, you might need to create first an empty repo with the same name as your local repo.
That way, GitKraken can find a matching repo name in your GitHub account.
Or you could select "URL", and enter the right GitHub repo url directly there. Which is what Jim Meyer's answer confirms above.
Note that GitKraken 6.5 (January 2020) will create, then add a GitHub fork repo automatically!
Forking GitHub Repositories in GitKraken
Formerly, users were required to leave GitKraken, go to their hosting service, fork the desired repository, come back to GitKraken, find the related remote, and then find the forked repo. 😅
Now, GitHub users can fork repositories directly through the GitKraken GUI, no more time wasted context switching.
v6.5 allows users the ability to fork GitHub repositories in GitKraken through the GitHub integration.
Simply navigate to the remotes pane in the left panel and click the + button to add a remote.
If you don’t already have a fork on the selected GitHub repository, GitKraken will automatically present you with the fork option.
You will see the message “You have not yet forked microsoft/vscode on GitHub.”
Click the Fork and Add Remote button, and it will fork the repo and add it as a remote to the left panel.
Gitkraken (V3.3.4 64bits on windows) behaviour is strange at this feature level. Same name or URL input doesn't work for me.
So the best and quick way to attach the remote repo to your local is to use the simple Git command line in local repo directory (git#... is your remote URL Github, GitLab...):
> git remote add origin git#...
Gitkraken recognise dynamically it after less than 5 second . Then you can push your existing local files.
Not to add to an old posting but I had the same issue and found this article first so wanted to help anyone else having this issue.
You can get to it by doing the following.
Click the folder icon in the top left corner
Click Clone
Go to the GitHub tab and you will see all your GitHub repos. Clone the one you want and then open it and you are set.

How to view list of changes to fetch from upstream/origin, or changes to push to upstream/origin

I'm trying to get a feel for how to do certain things in TortoiseGit that are pretty intuitive in TortoiseHG.
TortoiseHG has the Workbench which basically is my central tool to sync the local repository with remote ones: upstreams and origin.
It is easy to see what changes I'm missing locally (so I need to fetch them) or remotely (so I need to push them).
What is similar functionality in TortoiseGit?
How can I see a list of changes from a remote origin or upstream that I want to fetch locally?
How can I see a list of changes locally that want to push to the origin or upstream?
Maybe TortoiseGit does not have those; if not: please suggest tools that do.
My answer doesn't directly apply to TortoiseGit, but im sure you will find the equivalent features easily.
Git is a distributed version control system. In order to see the remotes changes, you need to fetch them first:
git fetch
Then you can use git diff to view the differences between your current branch, or even your current (dirty) working directory.
Alternatively you may use git merge --dry-run to see what has to be merged.
To see the things you have changed but not commited (uncommited changes) just type git status.
SourceTree can do this: without the need to fetching, it shows I'm 1 change behind on the upstream remote.
After pulling it, it shows the origin remote is 2 changes behind on master.

How to commit hg repo with GIT submodule which should be read only?

my Hg repo now needs to include a Git submodule (Restkit) as per the advised method in the site wiki.
However, I am not updating the git contents and should only be potentially reading/pulling in changes from the host.
It appears that when I came to make my first push of my main Hg repo it baulked at the Git one asking for a password. I think this may be because its attempting to authenticate against the Git site as well.
My questions are can I arrange this so that the Git repo is read-only(pull) or even static and/or get round the log in issue. Obviously the two different repos have different credentials.
Thanks.
P.S. using Atlassian SourceTree 1.5.3 on OS X 10.8.2, Xcode 4.5.1
I've just re-read this;
2.6. Synchronizing in subrepositories
Subrepos don't automatically track the latest changeset of their sources. Instead, they are updated to the changeset that corresponds with the changeset checked out in the top-level changeset. This is so developers always get a consistent set of compatible code and libraries when they update.
Thus, updating subrepos is a manual process. Simply run 'hg pull' and 'hg up' in the target subrepo, test in the top-level repo, then commit in the top-level repo to record the new combination. The onsub extension can be used to automate that.
Assume this means its not pulling the sub? but I still have the above issue of the password request.
You moved in the right direction, but not finished all required steps.
You have to have subrepository, create it by hand... and don't mix real subrepository with a) independent b) nested repository
When you'll convert nested to subrepo push into master repo will not perform push to subrepo (except it requested)

Resources