Search code examples
c#gitvisual-studiogit-gui

Visual Studio Project - Git Gui Problems


i have a little problem using gitgui for a Visual Studio project... there is a .gitignore file in the original Repository to exclude temporary files / the obj folder.

I tried cloning (Full Repository Clone) to my Home Folder from a network drive (Server Drive) - changed something. Tried to Commit it - it still commits the obj folder, i tried deleting the obj folder and get the error:

Pushing to I:/VPR/GIT/BrainFAQ_V3 To I:/VPR/GIT/BrainFAQ_V3 ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'I:/VPR/GIT/BrainFAQ_V3' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Maybe anyone can help me how to fix this.


Solution

  • Follow below steps

    1. Connect Visual Studio with Git Server
    2. Clone in Local folder of your system
    3. Open the solution that just got retrieved from Git Server to your local system
    4. Do the changes and build the application.
    5. Delete the folder you do not want to commit in Git from Visual studio, your .sln file of project will get changed accordingly or can use .gitignore and specify the files that you do not commit to Git Server. For More refer https://help.github.com/articles/ignoring-files/
    6. Now, commit and push the changes to Git Server
    7. Step 6 will be success only if there is not commit happened on master branch from the time you cloned the application.