signup / singn in to github.com
yum install git
git config --global user.name "urgensherpa"
git config --global user.email "urgen.sherpa@outlook.com"
create new repository in github <using webbrowser>
eg. repo name is test
#mkdir /home/nepal/test
#cd /home/nepal/test
git init
git remote add origin https://github.com/urgensherpa/test.git
^ ^
<username>/<reponame>
make some files in /home/nepal/test
git add dbconnect.php <update only 1 file>
git add . <update all/multiple current dir>
git commit -m 'first commit'
git push origin master
<enter your user name and password for github>
check in your github.com account to see changes
when you change your files
git add .
git commit -m 'second commit'
git push origin master
<enter your user/password for github.com>
edit some file eg. function.php
git add .
git commit -m 'third commit'
git reset --soft HEAD^ #this will reset the commit but the change made in file function.php is as is
git reset --hard HEAD^ #it will reset + changes made is reverted back to last commit that is second commit
==============cloning=================
git clone https://github.com/urgensherpa/test.git
ls -l #see the cloned repo in your local current dir
make changes in files
echo "test abcd" >> dbconnect.php
git add .
git commit -m "added new file"
git push origin master
<user/pass for github.com>
===================================
http://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo
Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or
yum install git
git config --global user.name "urgensherpa"
git config --global user.email "urgen.sherpa@outlook.com"
create new repository in github <using webbrowser>
eg. repo name is test
#mkdir /home/nepal/test
#cd /home/nepal/test
git init
git remote add origin https://github.com/urgensherpa/test.git
^ ^
<username>/<reponame>
make some files in /home/nepal/test
git add dbconnect.php <update only 1 file>
git add . <update all/multiple current dir>
git commit -m 'first commit'
git push origin master
<enter your user name and password for github>
check in your github.com account to see changes
when you change your files
git add .
git commit -m 'second commit'
git push origin master
<enter your user/password for github.com>
edit some file eg. function.php
git add .
git commit -m 'third commit'
git reset --soft HEAD^ #this will reset the commit but the change made in file function.php is as is
git reset --hard HEAD^ #it will reset + changes made is reverted back to last commit that is second commit
==============cloning=================
git clone https://github.com/urgensherpa/test.git
ls -l #see the cloned repo in your local current dir
make changes in files
echo "test abcd" >> dbconnect.php
git add .
git commit -m "added new file"
git push origin master
<user/pass for github.com>
===================================
http://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo
Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or
gitignore files. You can add these files after your project has been pushed to GitHub.
- Open Terminal (for Mac users) or the command prompt (for Windows and Linux users).
- Change the current working directory to your local project.
-
Initialize the local directory as a Git repository.
git init -
Add the files in your new local repository. This stages them for the first commit.
git add . # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
- Commit the files that you've staged in your local repository.
git commit -m 'First commit' # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
At the top of your GitHub repository's Quick Setup page, click
- to copy the remote repository URL.
-
In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
git remote add origin remote repository URL # Sets the new remote git remote -v # Verifies the new remote URL
-
Push the changes in your local repository to GitHub.
git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin
git init git add . git commit -m "Initial commit" git remote add origin <project url> git push -f origin master
No comments:
Post a Comment