I'm using the GitHub application for windows to transfer my code between my local and the server. I've made two ASP.net services thus far, which work fine- however my latest c# service's .exe and related files aren't picked up by the GitHub app, meaning when I pull from the server, the .exe of the service isn't available to allow installation. (From the debug folder, the installation.log file is picked up, but not the .exe and some attached .dlls)
I've reviewed the directory, and there's no git.ignore instructing the app to ignore it.
Furthermore, when I make changes to my existing services, their .exe is updated, and picked up by the app and allowed to transfer.
Why doesn't my new service's .exe and related installation files get picked up?
I'm using VS2008 (Don't judge me, it's comfortable).
Any advice appreciated, thanks.
Hey actually something like that happened to me once with the Github for Windows. Well at least for what I understand is that the file doesn't get added to the remote git repo.
I would start the git shell:
Open the repo you're working on >> Tools and Options (Button) >> Open a shell here
There try this to see if file is added to the repo:
git ls-files yourService.exe --error-unmatch
if not try figuring out if it's ignored some how:
git check-ignore -v -- yourService.exe
if you get nothing, it's not ignored. If you do get output it is ignored somehow.
So first if it's ignored force add it manually:
git add -f yourService.exe
Now commit and push it to the server. In case you've never done this manually use:
git commit yourService.exe "This is a commit message for one file only..." (For commiting on a specific file)
or if you want to commit on all changes and added files use:
git commit -a yourService.exe "This is a commit message for all changes and added files..."
In the case it's not even ignored you may have merge problems with the server, in that case you have to to force push to server by using: git push -f <remote> <branch> (e.g. git push -f origin master) which is very well explained by Trev Norris here: Force "git push" to overwrite remote files.
After that it should be solved, I kinda stopped using Github for Windows because of these ignore issues (which might be purposely developed but I do it manually and use www.github.com for visuals).
Hope this helps you.
Related
I have my ASP.NET MVC Project Repository in GitHub.
By using Git Extensions I have taken the Clone into my local machine. I have added new Folders / .cs files / .aspx files etc.
I have Committed all the new files using TortoiseGit Commit by Right Clicking on each folder/files successfully.
Since I have added new files/folders, then I have to commit the Project file (*.csproj), when I try to commit I got the error:
"did not exit cleanly (exit code 1).
What can I do now? should I open the Project file directly in GitHub repository and update it from my local directory project file? like, copy and Paste!
It will provide any issue later on! let me know if any have this issue.
Maybe the file is taken by another process: try the same commit after closing other windows.
If not, check also the command-line alternative, after installing a Git for Windows (2.21 at the moment)
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.
Follow below steps
Connect Visual Studio with Git Server
Clone in Local folder of your system
Open the solution that just got retrieved from Git Server to your local system
Do the changes and build the application.
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/
Now, commit and push the changes to Git Server
Step 6 will be success only if there is not commit happened on master branch from the time you cloned the application.
I've been having trouble with VS2013 corrupting my Program.cs file (see this question), so I set up a Git repo and committed a version of my project. Sure enough, when I opened the project today, Program.cs was corrupt.
So I guess I need to pull the working version of Program.cs from the repo and replace the corrupted version with this clean one. I've been trying to learn how to use Git by reading Pro Git, but so far I haven't figured out how to do this. Strangely, when I run git status, there is no listing of modified: Program.cs under "Changes not staged for commit:". I do see modified: Relinker.v12.suo. I know that all of the .cs files in the project are being tracked, because after I add data to any other .cs file, save the changes, and rerun git status, the file ends up showing as modified:.
Sorry if this is a confusing question. I'm just trying to quickly get my head around source control, figure out what's going on with this file corruption, and restore a good version of the file.
You can revert the workspace state of your git working-copy to the currently "active" commit (also known as HEAD) by running:
git checkout HEAD -- .
The command here follows the syntax:
git checkout [refspec] -- [path]
HEAD will be expanded to point to the (as already mentioned) currently active revision that's committed.
If you only want to change a single file use:
git checkout HEAD -- path/to/file
On the command line I ran:
svn checkout --depth infinity "RepoURL"
It creates the directory matching the repo folder with all the same files but it is not a working copy. Right-clicking on it with TortoiseSVN gives a SVN upgrade working copy option and nothing else such as commit or update. If I try the same checkout with TortoiseSVN, it works fine and produces a working copy, green icon and all. I tried running svn upgrade in this new directory on the command line but that didn't change anything. I also tried a normal checkout using SharpSVN and c# by running SvnClient.Checkout and I had the same issue.
I have Subversion 1.7.18 and TortoiseSVN 1.7.15.
You might be pulling files defining the local project enviroment variables that's not same as your local env. - Show us the problem with your non functional project! this is too vague
I need to write git information: Commit name, tags, branch, etc
to a binary (exe) file.
It is needed to run strings * | grep git, on that file to simply view latest git info about it.
I know that AssemblyInfo is displayed when I run this command (without grep), but I'm facing two possible problems:
I'm not sure if I can write to AssemblyInfo from code, to run 'git log' command and then get its output and write into AssemblyInfo.
If I want to use command 'git log' then it's not going to work on Windows, but it is possible that my App will be built on Windows and not on unix environment.
Maybe you know another way to do that?
This is usually done in your build script, filling a templated version of your AssemblyInfo (look at mustache, a templating language).
This build step does the following:
get the necessary info with git plumbing commands (e.g. How to programmatically determine the current checked out Git branch)
generate the AssemblyInfo file using a template.
Then your software build continues as usual.
There is a .net wrapper for Git windows implementation. Some high profile projects use this implementation. https://github.com/libgit2/libgit2sharp, http://libgit2.github.com/