I want to commit my changes in Eclipse (using Git and Gerrit), but I can't generate any changeId that is necessary for the commit process. I haven't found any link during my online search. I checked the keys, I integrated in Eclipse, I can access to the Gerrit Git server without any problem.
Any Idea?
Best
Just for the record:
For the Eclipse EGerrit plugin to work one must:
Install the git commit hook as described here
Click on "Add Change-id" button in Eclipse as pictured
EGerrit "Add Change-id" button location
This will generate an empty change id full of zeroes, which will be replaced automatically with the actual change id after you commit.
If you want gerrit to insert it automatically make sure the file [your_project]/.git/config contains
[gerrit]
createchangeid = true
(The createchangeid = true line should be indented with a tab
If you forgot to add the change id and already committed you can amend your last commit (by clicking the corresponding button: second to the left from the change id button) and then hit the change id button. To add change ids to several commits see the first SO link.
Related
Sometimes I want to provide a link to some source code in the comment to an issue.
If I open repository in browser and find the fileI need, the link refers to master branch by default. It means that over time the code referred by the link will change, because the master will move together with commits history.
In GitHub and GitLab when you want to get a permanent link on a file you just opened, it is enough to press y on the keyboard and the link will switch from referring the master branch to particular commit hash it points to.
I.e. https://github.com/octocat/Hello-World/blob/master/README -> https://github.com/octocat/Hello-World/blob/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d/README
At work I use BitBucket server (v7.10.1, if it matters) and unfortunately the y does not work, and I also do not see any button on UI to get permanent link. How can I achieve the same result (get permanent link) on BitBucket server?
I know a couple of tricks I am not satisfied with:
using Bitbucket Linky plugin for Intellij, but I want a more light-weight way
pressing History button on a file, and choosing the most recent one (but it does not give you the master hash, it gives the hash of the last change of the file. And also this button won't work if the file has a single version and never changed after the 1st commit)
Got to the version you want, and then click 'Raw file' (top right hand side of screen)
The path in the address bar should now be a permanent link. It will be the raw version of the file unfortunately, but it is a permanent link.
I can remove a local tag very easy in the Git Repositories View of eclipse.
But if that tag was a remote tag (originally) and I make a push - nothing happens. On the next pull that tag will reappear again.
Neither Remote -> Push tags nor Remote -> Push -> Add all tag specs removed that tag from origin. And I've tried Add delete ref specification in the same dialog, but Eclipse won't let me add tag-name or :refs/tags/tag-name.
I know that I can use the command line, as described in "How to delete a git remote tag?", but I didn't find a way to do it from eGit.
Playing with Team -> Remote -> Push I found the solution.
I have to enter in Remote ref to delete:
refs/tags/my-tag-name
and add that to the specifications to push. When I finish the dialog the tag is removed from remote.
The same applies, if I just click Add All Tags Spec (or something else that creates a new row in Specifications to push), click on the Mode column to convert the Update into a Delete and enter the correct ref from above into the Destination Ref column.
Funny thing: The tag is not offered if I open the drop down of Remote ref to delete, but if I use Ctrl+Space I can choose from the list of tags (and branches) and it generates the correct ref spec.
I am using SVN for version control in MATLAB 2014b. I have edited my file 'main.m' three times and commited changes to SVN repository. Thus there are three versions of my file, say commmit1, commmit2 and commmit3. Now, I wanted to revert my file from commit3 to commit2, make some changes in commit2 and finally commit this edited version to create commit4. I have successfully reverted from commit3 to commit2 and made some changes in it. But, now I am unable to commit changes made to commit2. It shows error commit failed,'main.m' is out of date. Please help me in sorting out the issue.
If you are using TortoiseSVN as client the follow this procedure.
Select the file and right click and then click on TortoiseSVN
Proess the show log option from drop down menu andyou will see a window
select the specific checkin which you want to revert to.
Press right click and then press "Revert to this revision"
I'm new to github and currently only starting off using github for mac.
I have taken a clone of my client's website and made some development changes locally. Note: I'm literally working with the files in the directory I sync with.
I want to push only one small change as the rest is still under development. Is it possible to push only the one file?
Git pushes deal with commits, not files. You'll need to create a commit that contains your selected changes. This is one area where Git's index is really handy.
Let's say you've modified two files, foo and bar.
If you want to commit only the changes to foo, using the command line you can do
git add foo
git commit
This will create a new commit updating foo, but bar's changes will remain only in your working copy. You can now push the new commit.
It's been a while since I've used the graphical GitHub tools, and I've only used them on Windows, but I believe the way to commit only certain files is to check or uncheck the box beside each file before you commit. You can see these checkboxes in their documentation:
You can go even further. If some of the changes in bar should be part of a commit, but not all of them, you can do something like git add --patch, which will break your changes up into chunks and prompt you for the ones to add to the index (these are the ones that will be included when you commit).
On GitHub for Mac you can do this too:
Select one or more lines to commit by clicking on the line numbers in the gutter. In the latest release, you can select a block of changes at a time. Hover over the right hand side of the line numbers to get a preview of what will be selected, and click to select.
See the documentation for git-add for details.
I can push a tag, but not using Push Tag... from the Tags item in the Git Repositories view.
Right-click on Tags
Choose Create Tag...
Entered the Tag name, Tag message and selected the commit using the Advanced button.
Choose OK
With the Tags folder expanded, right-click on the newly created tag and choose Push Tag...
Configured remote repository is already set, so I choose Next
CTRL + SPACE to bring up the list of remotes. (I get refs/heads/master)
Select Finish
I get: rejected non-fast-forward.
I've also tried configuring push with refs/tags/*:refs/tags/*
The Push Tag... wizard is much too complicated at the moment, yes. Try entering refs/tags/<nameofyourtag> as the target ref name.
In EGit 3.2 (to be released in December 2013), the wizard is much nicer, see the screenshot from the associated bug report.