• Home
  • How to use bitbucket on Centos

How to use bitbucket on Centos

December 18, 2015 Ning 0 Comments

1. Install git

yum install git
git config --global user.name "Ning Ma"
git config --global user.email "xxx@xxs.com"

2. Clone file from the bitbucket

git clone https://xxx@bitbucket.org/xxx/xxx.git

3. Commit a file

git init
git add test.php
git commit -m "some note"

*add all new files

cd folder
git add *

4. Push to bitbucket

git remote add projectName https://xxx@bitbucket.org/xxx/xxx.git
git push projectName master

5.Push only changed files

git add -u
git commit -m "your note"
git push projectName master

6. Get git repos name

git remote

or

git remote -v 

7. get repo content to the local (overwrite)

git fetch projectName master

8. get repo content and merge to the local

git merge master

9. get lasted file

git reset --hard HEAD
git clean -f //remove local file, be care this command
git pull projectName master

leave a comment

*