Putting Existing Visual Studio project on remote server using Git

On Linux server:

mkdir my_project.git
cd my_project.git
git --bare init

On Windows client:

If your EXISTING project is called ‘my_project’ rename the directory to ‘my_project.temp’

Get appropriate .gitignore from here:  https://github.com/github/gitignore

mv my_project my_project.temp
git clone ssh://youruser@yourserver.com/home/youruser/my_project.git
cd my_project
git init
cp ../my_project.temp
cp ../../.gitignore .
git add *
git add .gitignore
git commit -m "Initial commit" 
git push origin master

CONFIRM that my_project is complete by getting getting the project on a different machine/folder and compiling it before removing the my_project.temp folder

REAL LIFE OUTPUT ON WINDOWS SIDE

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects
$ mv WinLengthConsole WinLengthConsole.temp

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects
$ git clone ssh://git@gitserver/home/git/WinLengthConsole.git
Cloning into 'WinLengthConsole'...
git@gitserver's password:
warning: You appear to have cloned an empty repository.

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects
$ cd WinLengthConsole

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ cp ../WinLengthConsole.temp/* . -r

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ cp ../../.gitignore .

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ git add *
The following paths are ignored by one of your .gitignore files:
WinLengthConsole.v12.suo
Use -f if you really want to add them.

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ git add .gitignore

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ git status
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

        new file:   .gitignore
        new file:   WinLengthConsole.sln
        new file:   WinLengthConsole/App.config
        new file:   WinLengthConsole/Program.cs
        new file:   WinLengthConsole/Properties/AssemblyInfo.cs
        new file:   WinLengthConsole/WinLengthConsole.csproj


ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ git commit -m "Initial Commit"
[master (root-commit) 03e3cc4] Initial Commit
 6 files changed, 722 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 WinLengthConsole.sln
 create mode 100644 WinLengthConsole/App.config
 create mode 100644 WinLengthConsole/Program.cs
 create mode 100644 WinLengthConsole/Properties/AssemblyInfo.cs
 create mode 100644 WinLengthConsole/WinLengthConsole.csproj

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$ git push origin master
git@gitserver's password:
Counting objects: 10, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 6.62 KiB | 0 bytes/s, done.
Total 10 (delta 0), reused 0 (delta 0)
To ssh://gitserver/home/git/WinLengthConsole.git
 * [new branch]      master -> master

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/WinLengthConsole (master)
$
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s