Tuesday, April 10, 2018

Git Commond

Command line instructions

Git global setup
git config --global user.name "priyantha"
git config --global user.email "kdpsamaraweera@gmail.com"
Create a new repository
git clone http://172.26.86.150:8787/root/MicroServices_APITesting.git
cd MicroServices_APITesting
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Existing folder
cd existing_folder
git init
git remote add origin http://172.26.86.150:8787/root/MicroServices_APITesting.git
git add .
git commit -m "Initial commit"
git push -u origin master
Existing Git repository
cd existing_repo
git remote add origin http://172.26.86.150:8787/root/MicroServices_APITesting.git
git push -u origin --all
git push -u origin --tags

-GitLab(MY PART)

 How to setup global
 
	git config --global user.name "priyantha_inova"
	git config --global user.email "kdpsamaraweera@gmail.com"
	git config --global user.name
    git config --global user.email  

 If you already have project in gitlab and empty local repository
	you need to get git project to local repository
	
	git clone http://172.26.86.150:8787/root/Device_Sale.git
	 
 If you already have project in local repository but empty dev branch in gitlab
	You need to push your project to gitlab as initial commit
	
	git init
	git remote add origin http://172.26.86.150:8787/root/Device_Sale.git
	git add .
	git commit -m "Initial Commit"
	git push -u origin dev(If you need master then "git push -u origin master")
	
 If you already have project in dev branch and same projectt in local repository.
	 You need update dev branch with updated local project resources.
 
	 Then go to local folder
	 git pull http://172.26.86.150:8787/root/Device_Sale.git
	 git checkout dev(If you are in the master go to dev branch)
	 git add .
	 git commit -m "Something"
	 git remote add origine http://172.26.86.150:8787/root/Device_Sale.git  
	 git push -u origin dev (or git push -u -f origin dev)

No comments:

Post a Comment