You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

#--------------------------------------------------
#### create a directory
mkdir git-repo
cd git repo
 
#### download a copy of the initial upload
git clone https://USERNAME@bitbucket.org/SLAC-IEPM/imc14-tulip.git
cd imc14-tulip/
 
#### setup account
git config --global user.name "Your Name"
git config --global user.email you@example.com
#### Simplify accessing the URL by adding an alias 

git remote remove origin

git remote add origin https://YOURUSERNAME@bitbucket.org/SLAC-IEPM/imc14-tulip.git

#Now you'll just use "origin" when you want to use the URL

 
#### make changes
# vim ....
 
#### to see the status of the files (modified vs. unmodified)
git status
 
#### to commit files the -a option allows us to skip the explicit staging of the files
git commit -a -m "I revised section XYZ."
 
#### to upload the files the server
git push origin master
 
#### to view commit history
git log
 
#miscellaneous info
#--------------------------------------------------
#do not add or delete files with simple mv or rm, instead use git
git mv abstract.tex to anotherfilename.tex
 
#to add new/untracked files
git add <filename>
 
#then you'll upload them in the same manner
git commit -m "added file <filename>"
git push -u origin master

Using Browser to look at repository

https://bitbucket.org/SLAC-IEPM/imc14-tulip

Example

[cottrell@iepm ~]$ mkdir git-repo

[cottrell@iepm ~]$ cd git-repo

[cottrell@iepm ~/git-repo]$ git clone https://rlacotrell@bitbucket.org/SLAC-IEPM/imc14-tulip.git

Cloning into 'imc14-tulip'...

Password for 'https://rlacotrell@bitbucket.org': 

remote: Counting objects: 66, done.

remote: Compressing objects: 100% (64/64), done.

remote: Total 66 (delta 14), reused 0 (delta 0)

Unpacking objects: 100% (66/66), done.

[cottrell@iepm ~/git-repo]$ cd imc14-tulip/

[cottrell@iepm imc14-tulip]$ git config --global user.name "Cottrell"

[cottrell@iepm imc14-tulip]$ git config --global user.email cottrell@slac.stanford.edu

 

 

  • No labels