Arrow up in eclipse git staging - java

When I try to make a commit and push, an upwards arrow appears next to the project name. This occurs in eclipse and I do not know how to solve it. I have been waiting for some time and it does not seem to go away. The changes that I have make to the project are not reflected in the repository. Help would be appreciated.

From the eGit User Guide:
↑N – The local branch has N commits that are not yet on the
remote-tracking branch. This can be read as "N commits to
push".

Related

Trying to push to github reverted hours of progress

I am making a Minecraft mod with java and recently, Minecraft had a new update, so I had to update my mod accordingly.
I started from scratch making a new mod folder, and copied and fixed everything. Now that I have everything working, I thought I'd push my new mod to a new branch in my github repository.
I Initialized git in my VScode project, and I committed all changes.
Then added my github repository and tried to push to main.
I checked github and there were no changes. I looked back to my project and realized that my files were replaced with the old files from my github repo.
I did not pull, or try to merge, I just tried to push my files to my repository, and that caused days of work to be deleted from my PC.
Now, Why did this happen, How can I avoid it in the future, and is there anyway to revert what github did?
For some reason, There was a hidden local branch that didn't want to show up. If you have this issue try git branch -a or try checking your IDE's timeline (if you have that.)

Intellij Idea, Git : Revert commit mechanism not working

I am working on managing our project through GIT. I have Intellij Idea and Git running. The git project is running on one of our servers, which are we connecting through ssh.
Currently, everything is working fine except reverting commits. Somehow the reverts are either failing or not changing anything.
For reverting any last commit, I am going in VCS-->Git-->Reset head(Hard), but it is not helping. Before doing that I have pushed commit to master and I am currently(always) working on master. Is that a problem and is that causing revert to not function.
Now, as you can see in the screenshot below, the last commit named Test1234 is responsible for removing a simple System.out and I am trying to revert it commit Test123, which adds a System.out. What am I doing wrong?
Output of git status :
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
The commits in GitGraken :
I don't know which information related to git to post. Kindly let me know if anything is required.
Try right click to the previous commit in IntelliJ and choose reset current branch to here
When I activate this plugin right it works as the previous image
Perhaps try github's commandline, you'd be able to identify the problem. I also had problems, github's commandline is much better and works faster (especially for reverting / deleting commits).
See http://christoph.ruegg.name/blog/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.html as reference

GIT in eclipse: unable to push, after checking out an old version and change that

I am using GIT in eclipse. I needed to checkout some older version, so I opened the history in eclipse and right click on the one I wanted and clicked "checkout". I applied the changes I wanted to make, and at the end I used GIT -> commit, and after inserting the description pressed "commit and push". However it said "There is nothing to push". The push button is inactive as well, and when I checked the bitbucket web page related to my source, this last commit is not recorded! what can I do to push this version into bitbucket?
You have a detached head situation. You have to create a temporary branch and merge this branch back.
This should do the trick:
git branch my-temporary-work
git checkout master
git merge my-temporary-work

how to I revert my solutions to resolve the conflicts?

I have made a few changes, then pulled from git.
I have had merge conflicts after pulling from git.
I have resolved these conflicts, but my app doesn't work as expected.
How can I revert my solutions (undo) conflict resolution?
I'm using 'egit', and 'source tree'
btw, what is a recommended conflict resolver tool?
You can use git merge --abort to abort the whole merge process and take the repo to the state prior to merging.
git reset --hard HEAD~1 will put your code and git repo both back to where they were before the last commit, which is probably the merge commit. Then you can try merging again.
If you don't care about the changes you had, you can always nuke everything local and start with a fresh git clone.

Git in netbeans - resolving conflicts

I am using Git in netbeans and I wanted to commit my changes, however first I did a pull, and now there are conflicts.
On the left, I have a .java class that is in red because of conflicts, and I've right clicked it and selected Resolve Conflicts, and went through those steps.
But it still won't let me commit. I would like to override the current HEAD revision with my code, however it won't let me commit. How do I do this?
And when I select the file and choose to see Git -> Diff, it only lets me replace or delete the code in my working copy with the code from the HEAD, rather than replace the code in the HEAD.
Basically, I want to commit my code, not revert, etc. How do I do this in netbeans? It keeps telling me I cannot commit because of conflicts.
I just solved my issue, hope it helps.
1) Updated to Netbeans 7.1.2 IDE, restarted new IDE.
2) Open Git Repository Browser (used a (no branch) local branch) and switch to the branch with the issues both under the Team menu (it will be marked as a no-branch by default, check for the long "Md5 sum" to be the same).
3) Pull other needed code from other branches (in case its needed, I had to in my case).
4) Now edit/paste the code you want to overwritte. (This will turn the filename to red font).
5) Simply right click the file, Git>Resolve Conflicts (and it will do its magic and turn the filename to blue font).
6) Commit your local branch and finish.

Categories

Resources