how to associate the already checked in(pushed) code with a work item in a GIT2019 Community Moderator ElectionHow to modify existing, unpushed commits?How to remove local (untracked) files from the current Git working tree?How to undo 'git add' before commit?How do I undo the most recent commits in Git?How do I force “git pull” to overwrite local files?How do I check out a remote Git branch?How do I delete a Git branch both locally and remotely?Undo a Git merge that hasn't been pushed yetHow do I push a new local branch to a remote Git repository and track it too?How to revert a Git repository to a previous commitHow do I rename a local Git branch?

What would be the most expensive material to an intergalactic society?

Marriage green card at end of current visa with 2 Year residency requirement waiver in-process, question

Why would one plane in this picture not have gear down yet?

Virginia employer terminated employee and wants signing bonus returned

Possible answer to the Heaven Hell Door riddle

Is this Paypal Github SDK reference really a dangerous site?

How to secure an aircraft at a transient parking space?

Does "Until when" sound natural for native speakers?

How to draw cubes in a 3 dimensional plane

Doesn't allowing a user mode program to access kernel space memory and execute the IN and OUT instructions defeat the purpose of having CPU modes?

How can I ensure my trip to the UK will not have to be cancelled because of Brexit?

Conservation of Mass and Energy

Can one live in the U.S. and not use a credit card?

bad quality map when exporting as PDF

Why doesn't this Google Translate ad use the word "Translation" instead of "Translate"?

Having the player face themselves after the mid-game

If I receive a SOS signal, what is the proper response?

Coax or bifilar choke

Are there historical instances of the capital of a colonising country being temporarily or permanently shifted to one of its colonies?

Recommendation letter by significant other if you worked with them professionally?

When traveling to Europe from the US, do I need to purchase a different power strip?

Accepted offer letter, position changed

Rewrite the power sum in terms of convolution

How are showroom/display vehicles prepared?



how to associate the already checked in(pushed) code with a work item in a GIT



2019 Community Moderator ElectionHow to modify existing, unpushed commits?How to remove local (untracked) files from the current Git working tree?How to undo 'git add' before commit?How do I undo the most recent commits in Git?How do I force “git pull” to overwrite local files?How do I check out a remote Git branch?How do I delete a Git branch both locally and remotely?Undo a Git merge that hasn't been pushed yetHow do I push a new local branch to a remote Git repository and track it too?How to revert a Git repository to a previous commitHow do I rename a local Git branch?










0















I have already pushed the code without associating with a work item(defect id) raised in git but forgot to associate code changes with a work item in a GIT. how will I edit that push and associate with defect id now?










share|improve this question






















  • Possible duplicate of How to modify existing, unpushed commits?

    – phd
    Mar 7 at 8:55











  • stackoverflow.com/search?q=%5Bgit%5D+how+to+edit+commit

    – phd
    Mar 7 at 8:55















0















I have already pushed the code without associating with a work item(defect id) raised in git but forgot to associate code changes with a work item in a GIT. how will I edit that push and associate with defect id now?










share|improve this question






















  • Possible duplicate of How to modify existing, unpushed commits?

    – phd
    Mar 7 at 8:55











  • stackoverflow.com/search?q=%5Bgit%5D+how+to+edit+commit

    – phd
    Mar 7 at 8:55













0












0








0








I have already pushed the code without associating with a work item(defect id) raised in git but forgot to associate code changes with a work item in a GIT. how will I edit that push and associate with defect id now?










share|improve this question














I have already pushed the code without associating with a work item(defect id) raised in git but forgot to associate code changes with a work item in a GIT. how will I edit that push and associate with defect id now?







git






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 6:25









Tamal DasTamal Das

112




112












  • Possible duplicate of How to modify existing, unpushed commits?

    – phd
    Mar 7 at 8:55











  • stackoverflow.com/search?q=%5Bgit%5D+how+to+edit+commit

    – phd
    Mar 7 at 8:55

















  • Possible duplicate of How to modify existing, unpushed commits?

    – phd
    Mar 7 at 8:55











  • stackoverflow.com/search?q=%5Bgit%5D+how+to+edit+commit

    – phd
    Mar 7 at 8:55
















Possible duplicate of How to modify existing, unpushed commits?

– phd
Mar 7 at 8:55





Possible duplicate of How to modify existing, unpushed commits?

– phd
Mar 7 at 8:55













stackoverflow.com/search?q=%5Bgit%5D+how+to+edit+commit

– phd
Mar 7 at 8:55





stackoverflow.com/search?q=%5Bgit%5D+how+to+edit+commit

– phd
Mar 7 at 8:55












2 Answers
2






active

oldest

votes


















0














Assuming this is your last commit, the way I usually do is first take a copy of your local folder in case things goes south.



  1. Undo last commit. git reset HEAD~1

  2. Add a new commit with all changes.

  3. Push new branch with force overwriting the remote git push -f

p.s. Depending on git server that you use, you might need additional permission for this.






share|improve this answer






























    0














    git rebase -i "commit hash you want to change



    This will open your default editor (usually vi) with a list of commits and actions for each one. By default, the action is pick.



    For any commit you wish to change the message, change pick to reword.



    Save and quit (in vi: :wq).



    For each such commit, you'll get an editor to edit the commit message. Change it as you see fit, save and quit.



    Once you're done editing all the commit messages, you'll return to the command prompt, and have a new tree with the updated messages.



    You can now upload them to github by using git push origin --force.



    If you just need to fix your last commit, you can replace steps 1-4 with git commit --amend.






    share|improve this answer








    New contributor




    Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.



















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55037313%2fhow-to-associate-the-already-checked-inpushed-code-with-a-work-item-in-a-git%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Assuming this is your last commit, the way I usually do is first take a copy of your local folder in case things goes south.



      1. Undo last commit. git reset HEAD~1

      2. Add a new commit with all changes.

      3. Push new branch with force overwriting the remote git push -f

      p.s. Depending on git server that you use, you might need additional permission for this.






      share|improve this answer



























        0














        Assuming this is your last commit, the way I usually do is first take a copy of your local folder in case things goes south.



        1. Undo last commit. git reset HEAD~1

        2. Add a new commit with all changes.

        3. Push new branch with force overwriting the remote git push -f

        p.s. Depending on git server that you use, you might need additional permission for this.






        share|improve this answer

























          0












          0








          0







          Assuming this is your last commit, the way I usually do is first take a copy of your local folder in case things goes south.



          1. Undo last commit. git reset HEAD~1

          2. Add a new commit with all changes.

          3. Push new branch with force overwriting the remote git push -f

          p.s. Depending on git server that you use, you might need additional permission for this.






          share|improve this answer













          Assuming this is your last commit, the way I usually do is first take a copy of your local folder in case things goes south.



          1. Undo last commit. git reset HEAD~1

          2. Add a new commit with all changes.

          3. Push new branch with force overwriting the remote git push -f

          p.s. Depending on git server that you use, you might need additional permission for this.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 at 6:37









          Lolitha RatnayakeLolitha Ratnayake

          1762319




          1762319























              0














              git rebase -i "commit hash you want to change



              This will open your default editor (usually vi) with a list of commits and actions for each one. By default, the action is pick.



              For any commit you wish to change the message, change pick to reword.



              Save and quit (in vi: :wq).



              For each such commit, you'll get an editor to edit the commit message. Change it as you see fit, save and quit.



              Once you're done editing all the commit messages, you'll return to the command prompt, and have a new tree with the updated messages.



              You can now upload them to github by using git push origin --force.



              If you just need to fix your last commit, you can replace steps 1-4 with git commit --amend.






              share|improve this answer








              New contributor




              Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.
























                0














                git rebase -i "commit hash you want to change



                This will open your default editor (usually vi) with a list of commits and actions for each one. By default, the action is pick.



                For any commit you wish to change the message, change pick to reword.



                Save and quit (in vi: :wq).



                For each such commit, you'll get an editor to edit the commit message. Change it as you see fit, save and quit.



                Once you're done editing all the commit messages, you'll return to the command prompt, and have a new tree with the updated messages.



                You can now upload them to github by using git push origin --force.



                If you just need to fix your last commit, you can replace steps 1-4 with git commit --amend.






                share|improve this answer








                New contributor




                Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






















                  0












                  0








                  0







                  git rebase -i "commit hash you want to change



                  This will open your default editor (usually vi) with a list of commits and actions for each one. By default, the action is pick.



                  For any commit you wish to change the message, change pick to reword.



                  Save and quit (in vi: :wq).



                  For each such commit, you'll get an editor to edit the commit message. Change it as you see fit, save and quit.



                  Once you're done editing all the commit messages, you'll return to the command prompt, and have a new tree with the updated messages.



                  You can now upload them to github by using git push origin --force.



                  If you just need to fix your last commit, you can replace steps 1-4 with git commit --amend.






                  share|improve this answer








                  New contributor




                  Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  git rebase -i "commit hash you want to change



                  This will open your default editor (usually vi) with a list of commits and actions for each one. By default, the action is pick.



                  For any commit you wish to change the message, change pick to reword.



                  Save and quit (in vi: :wq).



                  For each such commit, you'll get an editor to edit the commit message. Change it as you see fit, save and quit.



                  Once you're done editing all the commit messages, you'll return to the command prompt, and have a new tree with the updated messages.



                  You can now upload them to github by using git push origin --force.



                  If you just need to fix your last commit, you can replace steps 1-4 with git commit --amend.







                  share|improve this answer








                  New contributor




                  Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Mar 7 at 6:39









                  Anugeetha VAnugeetha V

                  11




                  11




                  New contributor




                  Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Anugeetha V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55037313%2fhow-to-associate-the-already-checked-inpushed-code-with-a-work-item-in-a-git%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

                      Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                      List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229