Sunday, 23 October 2016

more git commands (2)


10. Adding All Changes
You also can use wildcards if you want to add many files of the same type. Suppose that I've added a bunch of .txt files into
your directory.I put some in a directory named "octofamily" and some others ended up in the root of our "octobox" directory.
Luckily, we can add all the new files using a wildcard with git add. Don't forget the quotes!
git add '*.txt'

11. To push our local repo to the GitHub server we'll need to add a remote repository.
git remote add origin https://github.com/try-git/try_git.git

12. Pushing Remotely
git push -u origin master

13. Pulling Remotely

14. git reset
You can unstage files by using the git reset command.
git reset octofamily/octodog.txt

15. git rm
 git rm command which will not only remove the actual files from disk,
 but will also stage the removal of the files for us
 git rm '*.txt'

16. git merge
merge your changes from the clean_up branch into the master branch:
git merge clean_up

17. git help
run git help to bring the manual
git help
git help config

18. git add --all
add all the deleted, newly added or modified files to the staged area.

19 git add <list of files>
like git add readme.txt a.c b.h

20 git add directory
   git add /home/jtony/src/
will add all the changes under src directory.

No comments:

Post a Comment