Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

Friday, July 28, 2017

Uninstall git which is installed from source

I installed git 2.9.4 from source code via 'configure' and 'make install'. For some reason I need to uninstall it, but it could not be uninstalled with 'make uninstall'.

sudo find /usr/local -depth -iname 'git*' -exec rm -rf {} \;

The above command would delete all git related files.

Tuesday, January 20, 2015

Git cheat sheet


git clone
git branch hotfix@tianli
git checkout hotfix@tianli

modify code

git commit –a

arc diff


git checkout master
git pull

git checkout hotfix@tianli
git rebase master

git checkout master
git merge hotfix@tianli
git push


next round …


Saturday, August 23, 2014

Move Existing Xcode project into Bitbucket

I have been using Bitbucket to manage the source code of my personal projects. But I always use the git command in Terminal.

I started working on a new project today and I found it's very easy to move an existing project, which has been managed with the embedded git in Xcode, into Bitbucket. Here are the steps:
  1. Create a new repository for your project in Bitbucket.
  2. Xcode -> Preference, then press the add button("+") to add a repository with the address you created in Bitbucket for your project. e.g.
    https://allesgut@bitbucket.org/allesgut/racenews.git
  3. cd your home directory for your project. e.g.
    cd ~/dev/iOS/RaceNews
  4. set up git on your machine. e.g.
    git remote add origin https://allesgut@bitbucket.org/allesgut/racenews.git
  5. Commit your changes to local server:
    Xcode -> Source Control -> Commit
  6. and push your projects to Bitbucket.
    Xcode -> Source Control -> Push
Now, you can check the source code in Bitbucket to see if the source code of your project has been moved to Bitbucket.

Tuesday, August 19, 2014

Use Bitbucket

First create a new repository in Bitbucket for your new project. Set the "Repository type" as "Git" and select your programming language. It is Python for my new project RaceNews.

Once your new repository is created, you can follow the instructions to set up your git from scratch.


Set up your git:

cd /path/to/your/projectgit initgit remote add origin https://allesgut@bitbucket.org/allesgut/racenews.git

Create your first file, commit, and push:


echo "Alex Xu" >> contributors.txtgit add contributors.txtgit commit -m 'Initial commit with contributors'git push -u origin master

Here is the file list in my project:
FOSs-MacBook:WebSpider fos$ find .
.
./contributors.txt
./output
./src
./src/sources
./src/sources/Chuangxinpai.py
./src/sources/Cnetnews.py
./src/sources/Forbeschina.py
./src/sources/FTchinese.py
./src/sources/Hbrchina.py
./src/sources/Investorchina.py
./src/sources/Reuterscn.py
./src/sources/Wallstreetcn.py
./src/sources/Yicai.py
./src/Spider.py
./src/tst
./src/tst/BS4Demo.py
./src/tst/Test.py
./src/WebUtil.py
Now I need to put the src files into the repository:
git add srcgit add outputgit commit -agit push
When you see the output "b225aae..529962f  master -> master", you can check that all your files should have been put to the repository in Bitbucket.